Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...


write a program to find the sum of the array elements in c
language?

Answers were Sorted based on User's Feedback



write a program to find the sum of the array elements in c language?..

Answer / 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

write a program to find the sum of the array elements in c language?..

Answer / raushan kumar

# include <stdio.h>
# include <conio.h>
void main()
{
int arr[value],sum=0;
int i;
clrscr();
printf("Enter data in array");
/*store data in array*/
for(i=1;i<value;i++)
{
scanf("%d",&arr[i]);
}
/*Print data in array*/
for(j=1;j<value;j++)
{
printf("%d",arr[i]);
sum=sum+arr[i];
}
/*Sum of array element*/
printf("\nArray Element Sum=%d",sum);
getch();
}

Is This Answer Correct ?    3 Yes 2 No

write a program to find the sum of the array elements in c language?..

Answer / uday

#include<stdio.h>
void main()
{
int a[i],sum=0;
printf("enter n value");
scanf("%d",&n);
for(i=0;i<n,i++)
{
scanf("%d",&a[i])
}
for(i=0;i<n;i++)
{
sum=sum+a[i];
}
printf("sum=%d");
}

Is This Answer Correct ?    2 Yes 1 No

write a program to find the sum of the array elements in c language?..

Answer / asish manoj k

#include <conio.h>
#include <iostream>

using namespace std;

int main(int argc, char *argv[])
{
int n,r=0,i,a[10],s=0;

printf("enter the size of the array");
scanf("%d",&n);

for(i=0;i<n;i++)
{
printf("enter the %d element",r);
scanf("%d",&a[i]);
r=r+1;

}
for(i=0;i<n;i++)
{

s=s+a[i];
}

printf("sum of the elements of the array is %d",s);
system("PAUSE");
return EXIT_SUCCESS;
}

Is This Answer Correct ?    2 Yes 1 No

write a program to find the sum of the array elements in c language?..

Answer / mohd hayyan

#include<stdio.h>
#include<conio.h>
void main()
{
int a[i],i,sum=0;
clrscr();
printf("enter the array");
for(i=0;i<3;i++)
scanf("%d",&a[i]);
for(i=0;i<3;i++)
{
sum=sum+a[i];
}
for(i=0;i<3;i++)
{
printf("a[%d]=%d",i,a[i]);
}
printf("%d",sum);
getch();
}

Is This Answer Correct ?    1 Yes 0 No

write a program to find the sum of the array elements in c language?..

Answer / bishmeet singh

#include<stdio.h>
#include<conio.h>
void main()
{
int a[5],i,sum=0;
clrscr();
printf("enter the 5 elements to sum");
for(i=0;i<5;i++)
{
scanf("%d",&a[i]);
}
for(i=0;i<5;i++)
{
sum=sum+a[i];
}
printf("sum of the elements is %d",sum);
}

Is This Answer Correct ?    1 Yes 1 No

write a program to find the sum of the array elements in c language?..

Answer / sayeed khan

#include<stdio.h>
#include<conio.h>
int main()
{
int i,sum=0,a[30],n;

printf("Enter The Number=");

for(i=0;i<n;i++);

scanf("%d",&n);

sum=sum+a[i];

printf("the sum is %d\n",sum);

getch();
return 0;
}

Is This Answer Correct ?    1 Yes 1 No

write a program to find the sum of the array elements in c language?..

Answer / lalit suthar, nilod

// write a program to find the sum of the array elements in
c language?

#include<stdio.h>
#include<conio.h>

void main()
{
int a[5],i,sum=0;

clrscr();

printf("Enter the array elements\n");

for (i=0; i<5; i++)

scanf("%d",&a[i]);

// sum of array elements

for (i=0; i<5; i++)
{
sum=sum+a[i];
}

printf("Sum of array elements===%d",sum);

getch();
}

Is This Answer Correct ?    1 Yes 1 No

write a program to find the sum of the array elements in c language?..

Answer / 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

write a program to find the sum of the array elements in c language?..

Answer / ajay kumar pandit

Wap to calculste the sum number

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More C Interview Questions

what is the use of a array in c

6 Answers  


who is the founder of c

19 Answers   College School Exams Tests, HP,


Why doesnt that code work?

0 Answers  


int a=0,b=2; if (a=0) b=0; else b=*10; What is the value of b ?

6 Answers   TCS,


write a function to swap an array a[5] elements like a[0] as a[5],a[1] as a[4],....a[5] as a[0].without using more than one loop and use one array not to use temp array?

1 Answers   Zensar,


Explain a file operation in C with an example.

0 Answers   Amdocs,


What do you mean by invalid pointer arithmetic?

0 Answers  


Using which language Test cases are added in .ptu file of RTRT unit testing???

0 Answers  


hi friends how r u as soon in satyam my interview is start but i m very confusued ta wat i do plz help me frndz wat can i do plz tell me some question and answers related with "C" which r asked in the interview .

0 Answers   Aegis, CDAC, Infosys,


what is the difference between while and do while?

2 Answers  


if function is declared as static in one source file, if I would like to use the same function in some other source file...is it possible....how ?

2 Answers   NetApp,


Can you please explain the scope of static variables?

0 Answers  


Categories