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
What is malloc() function?
How do you redirect a standard stream?
main use of recursive function a) processing speed high b) reduce program length/reduce repeated statements c) if you do not, use iterative methods like, for, while or do-while d) all the above
What is c language used for?
How can you increase the size of a statically allocated array?
A variable that is defined in a specified portion of a program but can be used throughout the program a) global variable b) local variable c) character d) none
"%u" unsigned integer print the a) address of variable b) value of variable c) name of a variable d) none of the above
What is the main difference between calloc () and malloc ()?
Calculate the weighted average of a list of n numbers using the formula xavg = f1x1+f2x2+ ….+ fnxn where the f’s are fractional weighting factors, i.e., 0<=fi<1, and f1+f2+….+fn = 1
What is #line in c?
What is equivalent to ++i+++j?
What is bash c?
What is the difference between c &c++?
What is data structure in c programming?
can we implement multi-threads in c.