write a program which counts a product of array elements
lower than 10.



write a program which counts a product of array elements lower than 10...

Answer / 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

More C Interview Questions

what are the compilation steps? ( i want inside the compiler )

2 Answers  


Explain how can you be sure that a program follows the ansi c standard?

0 Answers  


what is the difference between #include<stdio.h> and #include "stdio.h" ?

3 Answers  


what is foreign key in c language?

1 Answers   ADP,


The __________ attribute is used to announce variables based on definitions of columns in a table?

0 Answers  


What is an volatile variable?

15 Answers   HP,


write a c program in such a way that if we enter the today date the output should be next day's date.

0 Answers  


Write the program with at least two functions to solve the following problem. The members of the board of a small university are considering voting for a pay increase for their 10 faculty members. They are considering a pay increase of 8%. Write a program that will prompt for and accept the current salary for each of the faculty members, then calculate and display their individual pay increases. At the end of the program, print the total faculty payroll before and after the pay increase, and the total pay increase involved.

0 Answers   Convergys,


Write a program that accepts a string where multiple spaces are given in between the words. Print the string ignoring the multiple spaces. Example: Input: “ We.....Are....Student “ Note: one .=1 Space Output: "We Are Student"

6 Answers   IBM,


Lists the benefits of c programming language?

0 Answers  


how to find turn around time in operating system?

3 Answers  


What do header files do?

0 Answers  


Categories