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 are run-time errors?
What do you mean by a sequential access file?
What are the different types of data structures in c?
What is nested structure in c?
Compare and contrast compilers from interpreters.
What is static memory allocation? Explain
write a program that declares an array of 30 elements named "income" in the main functions. then cal and pass the array to a programmer-defined function named "getIncome" within the "getIncome" function, ask the user for annual income of 30 employees. then calculate and print total income on the screen using the following function: "void getIncome ( ai []);
What is wrong in this statement? scanf(“%d”,whatnumber);
Why can’t we compare structures?
Explain what is dynamic data structure?
What is a void pointer? When is a void pointer used?
write a program to find the given number is prime or not
What are the scope of static variables?
Why c language?
Why is it that not all header files are declared in every C program?