write a program which counts a product of array elements
lower than 10.



write a program which counts a product of array elements lower than 10...

Answer / rajasekharreddy

#include<stdio.h>
#define SIZE 20
int main()
{
int arr[SIZE],arr_Size,i,mul=1;

printf("Printf array size\t");
scanf("%d",&arr_Size);

printf("\nenter numbers\t");
for(i=0;i<arr_Size;i++)
{
scanf("%d",&arr[i]);
}

printf("you entered numbers\t");
for(i=0;i<arr_Size;i++)
{
printf("%d\t",arr[i]);
}

for(i=0;i<arr_Size;i++)
{
if(arr[i]<10)
{
mul=mul*arr[i];
}
}

printf("\nout put is\t%d",mul);
return 0;
}

Is This Answer Correct ?    1 Yes 0 No

Post New Answer

More C Interview Questions

what is the difference between #include<stdio.h> and #include "stdio.h" ?

3 Answers  


Define and explain about ! Operator?

0 Answers  


Is struct oop?

0 Answers  


What are the different pointer models in c?

4 Answers  


What is meant by inheritance?

0 Answers  






Explain how do you generate random numbers in c?

0 Answers  


Write a program which calculate sum of several number and input it into an array. Then, the sum of all the number in the array is calculated.

2 Answers  


Write a program to print "hello world" without using a semicolon?

0 Answers  


#include<stdio.h> void main() { int a=10,b=20,c=30; printf("%d",scanf("%d%d%d",&a,&b,&c)); } what is the output for this?

4 Answers   IIIT,


What are the 4 types of programming language?

0 Answers  


Print all the palindrome numbers.If a number is not palindrome make it one by attaching the reverse to it. eg:123 output:123321 (or) 12321

7 Answers   HCL,


what is const volatile?

2 Answers  


Categories