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
write a progrmm in c language take user interface generate table using for loop?
What are header files and explain what are its uses in c programming?
What tq means in chat?
Explain what is a stream?
Badboy is defined who has ALL the following properties: Does not have a girlfriend and is not married. He is not more than 23 years old. The middle name should be "Singh" The last name should have more than 4 characters. The character 'a' should appear in the last name at least two times. The name of one of his brothers should be "Ram" Write a method: boolean isBadBoy(boolean hasGirlFriend , boolean isMarried, int age , String middleName , String lastName , String[] brotherName); isHaveGirlFriend is true if the person has a girlfriend isMarried is true if the person is married age is the age of the person middleName is the middle name of the person lastName is the last name of the person brotherName is the array of the names of his brothers
What is unary operator?
What is #include conio h?
If null and 0 are equivalent as null pointer constants, which should I use?
What does static variable mean in c?
Why is #define used?
What is structure packing in c?
What are inbuilt functions in c?
What is the general form of #line preprocessor?
How can you access memory located at a certain address?
What are void pointers in c?