write a program to find the sum of the array elements in c
language?
Answer Posted / atul lakhera
#include<stdio.h>
#include<conio.h>
void main()
{
int num[10], sum=0;
for(int i=0; i<10; i++)
{
printf("Enter number=");
scanf("%d", &num[i]);
}
printf("Sum of elemets=");
for(i=0; i<10; i++)
{
sum=sum+num[i];
printf("%d", sum);
}
getch();
}
| Is This Answer Correct ? | 2 Yes | 0 No |
Post New Answer View All Answers
What is a rvalue?
In c programming typeing to occupy the variables in memory space. if not useing the variable the memory space is wasted.ok, how to avoid the situation..? (the variable is used & notused)
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 []);
#define f(g,h) g##h main O int i=0 int var=100 ; print f ("%d"f(var,10));} wat would be the output??
What is echo in c programming?
hi send me sample aptitude papers of cts?
How to explain the final year project as a fresher please answer with sample project
Can you tell me how to check whether a linked list is circular?
In C language, the variables NAME, name, and Name are all the same. TRUE or FALSE?
What are the salient features of c languages?
Why do we use null pointer?
What is the general form of #line preprocessor?
Write a C program to count the number of email on text
What is gets() function?
How can you access memory located at a certain address?