SCHOOL OF CODE BUILDERS
Learn To CODE. Become A DEVELOPER.
Pages
HOME
DATA STRUCTURES
STRINGS
ARRAYS
MATRIX
BINARY TREES
LINKED LIST
STACK
QUEUE
SORTING
SEARCHING
C
PYTHON
PSEUDOCODE
CONTEST PROBLEMS
ALGORITHMS
PATTERNS
PHP
C PUZZLES
C INTERVIEW QUESTIONS
JAVA
C++
HASHING
RECURSION
BASIC C PROGRAMS
TCS-CODEVITA
FACEBOOK
CONTACT US
Find the product of 4 integers entered by a user. If user enters “0” skip it
Find the product of 4 integers entered by a user. If user enters “0” skip it
Input:
4 2 0 2
Output:
The product of numbers entered by you except '0' is 16
Implementation:
#include
int main(void) { int n; int i=0,product=1; while(i<4) { scanf("%d",&n); if(n==0) { i++; continue; } product *= n; i++; } printf("The product of numbers entered by you except '0' is %d",product); return 0; }
PREVIOUS
NEXT
HOME