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 |
Can we declare a function inside a function in c?
Is it possible to execute code even after the program exits the main() function?
How would you rename a function in C?
Write a program on swapping (100, 50)
What is the general form of #line preprocessor?
How would you write qsort?
What will be the result of the following program? main() { char p[]="String"; int x=0; if(p=="String") { printf("Pass 1"); if(p[sizeof(p)-2]=='g') printf("Pass 2"); else printf("Fail 2"); } else { printf("Fail 1"); if(p[sizeof(p)-2]=='g') printf("Pass 2"); else printf("Fail 2"); } } a) Pass 1, Pass 2 b) Fail 1, Fail 2 c) Pass 1, Fail 2 d) Fail 1, Pass 2 e) syntax error during compilation
What is your stream meaning?
Explain what is a 'locale'?
What are the advantages of using Unions?
N O S I E R + A S T R A L ---------------- 7 2 5 6 1 3
Input is "rama loves rajesh and rajesh Loves rama also and rajesh wear gloves and bloves" To print output is count the numbers of times repeted the word love without case sensitive.