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 the difference between struct and typedef struct in c?
What header files do I need in order to define the standard library functions I use?
What is difference between function overloading and operator overloading?
What are the types of type specifiers?
List out few of the applications that make use of Multilinked Structures?
Are pointers really faster than arrays?
What is c++ used for today?
Why functions are used in c?
Where we use clrscr in c?
Explain do array subscripts always start with zero?
Explain Basic concepts of C language?
What is the difference between malloc() and calloc()?
Why doesnt that code work?
What does calloc stand for?
What is wrong with this initialization?