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


Please Help Members By Posting Answers For Below Questions

How can I insert or delete a line (or record) in the middle of a file?

579


What is nested structure with example?

631


What is anagram in c?

521


any C program contains only one function, it must be a) void () b) main () c) message () d) abc ()

697


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

741






Why is c used in embedded systems?

616


What does c mean?

594


If I have a char * variable pointing to the name of a function ..

662


What is pointer to pointer in c?

637


Why calloc is better than malloc?

574


When should the register modifier be used? Does it really help?

622


How can I find out the size of a file, prior to reading it in?

628


What is variable in c example?

598


Explain what is dynamic data structure?

651


Can you please explain the scope of static variables?

608