write a program to find the sum of the array elements in c
language?
Answer Posted / madhura musale
#include<stdio.h>
#include<conio.h>
void main()
{
int i,a[10],sum;
clrscr();
printf("\n Enter the elements in an array :");
for(i=0;i<10;i++)
scanf("%d",&a[i]);
printf("\n The sum of elements of an array are :");
for((i=0;i<10;i++)
sum=sum+a[i];
printf("\t %d",sum);
getch();
}
| Is This Answer Correct ? | 25 Yes | 26 No |
Post New Answer View All Answers
What is return in c programming?
Explain how can I pad a string to a known length?
What are structure types in C?
What are the advantages of external class?
Want to know how to write a C program that connects to a MySQL server and checks if the InnoDB plug-in is installed on it. If so, your program should print the total number of disk writes by MySQL.
Is javascript based on c?
What are the restrictions of a modulus operator?
PROGRAM TO WRITE CONTENTS OF 1 FILE IN REVERSE TO ANOTHER FILE,PROGRAM TO COPY 1 FILE TO ANOTHER BY SPECIFYING FILE NAMES AS COMMAND LINE
Explain how can you check to see whether a symbol is defined?
Can math operations be performed on a void pointer?
What does the message "automatic aggregate intialization is an ansi feature" mean?
#define PRINT(int) printf("int = %d ",int) main() {< BR> intx,y,z; x=03;y=02;z=01; PRINT(x^x); z<<=3;PRINT(x); y>>=3;PRINT(y); }
What is an identifier?
What are the 5 organizational structures?
c program for searching a student details among 10 student details