write a program which counts a product of array elements
lower than 10.
Answer Posted / 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 View All Answers
How can I insert or delete a line (or record) in the middle of a file?
What is nested structure with example?
What is anagram in c?
any C program contains only one function, it must be a) void () b) main () c) message () d) abc ()
c programs are converted into machine language with the help of a) an interpreter b) a compiler c) an operatinf system d) none of the above
Why is c used in embedded systems?
What does c mean?
If I have a char * variable pointing to the name of a function ..
What is pointer to pointer in c?
Why calloc is better than malloc?
When should the register modifier be used? Does it really help?
How can I find out the size of a file, prior to reading it in?
What is variable in c example?
Explain what is dynamic data structure?
Can you please explain the scope of static variables?