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

Explain high-order and low-order bytes.

659


Why flag is used in c?

645


What are derived data types in c?

600


Are comments included during the compilation stage and placed in the EXE file as well?

662


In C programming, how do you insert quote characters (‘ and “) into the output screen?

880






What is the use of typedef in c?

574


Is it possible to pass an entire structure to functions?

548


how to write a c program to print list of fruits in alpabetical order?

1779


hi... can anyone help me to make a two-dimensinal arrays in finding the sum of two elements plzzz. thnx a lot...

1433


a function gets called when the function name is followed by a a) semicolon (;) b) period(.) c) ! d) none of the above

858


What are types of functions?

555


What is the maximum no. of arguments that can be given in a command line in C.?

657


What are the types of data types and explain?

661


List a few unconditional control statement in c.

552


What are enumerated types?

644