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


Please Help Members By Posting Answers For Below Questions

console I/O functions means a) the I/O operations done on disk b) the I/O operations done in all parts c) the input given through keyboard is displayed VDU screen d) none of the above

663


Can you define which header file to include at compile time?

593


what is the syallabus of computer science students in group- 1?

1846


What is ambagious result in C? explain with an example.

2060


Can we increase size of array in c?

546






Write a program, where i have a grid with many cells, how many paths are possible from one point to other desired points.

707


Explain two-dimensional array.

633


What are dangling pointers in c?

650


Find duplicates in a file containing 6 digit number (like uid) in O (n) time.

2618


What is pointers in c with example?

587


How can I rethow can I return a sequence of random numbers which dont repeat at all?

710


what is a function method?give example?

1918


The program will first compute the tax you owe based on your income. User is prompted to enter income. Program will compute the total amount of tax owed based on the following: Income Tax 0 - $45,000 = 0.15 x income $45,001 - $90,000 = 6750 + 0.20 x (income – 45000) $90,001 - $140,000 = 15750 + 0.26 x (income – 90000) $140,001 - $200,000 = 28750 + 0.29 x (income – 140000) Greater than $200,000 = 46150 + 0.33 x (income – 200000) Dollar amounts should be in dollars and cents (float point numbers with two decimals shown). Tax is displayed on the screen.

1070


Why pointers are used in c?

596


c language supports bitwise operations, why a) 'c' language is system oriented b) 'c' language is problem oriented c) 'c' language is middle level language d) all the above

619