write a program to find the sum of the array elements in c
language?
Answer Posted / mathews m
#include<stdio.h>
#include<conio.h>
void main()
{
int i,n,sum=0,x[20];
clrscr();
printf("enter the array space");
scanf("%d",&n);
printf("enter the elements");
for(i=0;i<n;i++)
scanf("%d"&x[i]);
for(i=0;i<n;i++)
{
sum=sum+x[i];
}
printf("the sum of elements in an array=%d");
}
getch();
| Is This Answer Correct ? | 1 Yes | 1 No |
Post New Answer View All Answers
"C" language developed by "Dennis Ritchie" at AT & T. his remarks are a) too general, too abstract b) could deal with only specific problems c) lost generality of BCPL and B restored d) no remarks
What is the basic structure of c?
What is meant by type casting?
Where are local variables stored in c?
What is the difference between char array and char pointer?
a value that does not change during program execution a) variabe b) argument c) parameter d) none
What are comments and how do you insert it in a C program?
What is structure in c language?
i got 75% in all semester am i eligible for your company
What are dangling pointers in c?
Explain what is wrong with this statement? Myname = ?robin?;
Is there any possibility to create customized header file with c programming language?
Explain what is the difference between text files and binary files?
Simplify the program segment if X = B then C ← true else C ← false
Is c dynamically typed?