ALLInterview.com :: Home Page            
 Advertise your Business Here     
Browse  |   Placement Papers  |   Company  |   Code Snippets  |   Certifications  |   Visa Questions
Post Question  |   Post Answer  |   My Panel  |   Search  |   Articles  |   Topics  |   ERRORS new
   Refer this Site  Refer This Site to Your Friends  Site Map  Bookmark this Site  Set it as your HomePage  Contact Us     Login  |  Sign Up                      
Google
   
 
Categories >> Software >> Programming Languages >> C
 
 


 

 
 C interview questions  C Interview Questions (2248)
 C++ interview questions  C++ Interview Questions (1106)
 VC++ interview questions  VC++ Interview Questions (342)
 Delphi interview questions  Delphi Interview Questions (510)
 Programming Languages AllOther interview questions  Programming Languages AllOther Interview Questions (644)
Question
write a program to find the sum of the array elements in c
language?
 Question Submitted By :: Srinivas
I also faced this Question!!     Rank Answer Posted By  
 
  Re: write a program to find the sum of the array elements in c language?
Answer
# 1
#include<stdio.h>
#include<conio.h>

void main()
{
int a[5];
int 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);
} // end of main()
 
Is This Answer Correct ?    199 Yes 48 No
Anuja Kulkarni
 
  Re: write a program to find the sum of the array elements in c language?
Answer
# 2
the above prog is perfect.. 
Is This Answer Correct ?    80 Yes 32 No
Shruti
 
 
 
  Re: write a program to find the sum of the array elements in c language?
Answer
# 3
#include<stdio.h>
#include<conio.h>
void main()
{
int n[5],sum=0,i=0;
clrscr();
for(i=0;i<4;i++)
{
scanf("%d",&n[i]);
}

for(i=0;i<4;i++)
{
sum=sum+n[i];
}
printf("sum are%d",sum);
getch();
}
 
Is This Answer Correct ?    44 Yes 23 No
Vaibhav
 
  Re: write a program to find the sum of the array elements in c language?
Answer
# 4
#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 ?    24 Yes 25 No
Madhura Musale
 
  Re: write a program to find the sum of the array elements in c language?
Answer
# 5
#include<stdio.h>
#include<conio.h>
void main()
{
int a[10],i,sum=0;
clrscr();
for(i=0;i<10;i++)
{
printf("\n enter an elements in array");
scanf("%d",&a[i]);
}
for(i=0;i<10;i++)
{
sum=sum+a[i];
}
printf("\n sum is %d",sum);
}
 
Is This Answer Correct ?    27 Yes 12 No
Karnik Ankit
 
  Re: write a program to find the sum of the array elements in c language?
Answer
# 6
#include<stdio.h>
#include<conio.h>
void main()
{
int a[10],i,sum=0;
clrscr();
for(i=0;i<10;i++)
{
printf("\n enter an elements in array");
scanf("%d",&a[i]);
}
for(i=0;i<10;i++)
{
sum=sum+a[i];
}
printf("\n sum is %d",sum);
}
 
Is This Answer Correct ?    18 Yes 10 No
Vijay
 
  Re: write a program to find the sum of the array elements in c language?
Answer
# 7
#include<stdio.h>
#include<conio.h>
void main()
{
int a[5];
int i,b=0;
printf("Enter the array elements\n");
for (i=0; i<5; i++)
scanf("%d",&a[i]);
for (i=0; i<5; i++)
{
b=b+a[i];
}
printf("Sum of array elements is %d",b);
}
 
Is This Answer Correct ?    13 Yes 9 No
Syed Shoaib
 
  Re: write a program to find the sum of the array elements in c language?
Answer
# 8
#include<stdio.h>
#include<conio.h>
void main()
{
int a[10],sum=0,n,i;
printf("Enter range");
scanf("%d",&n);
for(i=0;i<n;i++)
scanf("%d",&a[i]);
printf("The sum of all the elements in the given array
is\n");
for(i=0;i<n;i++)
sum=sum+a[i];
printf("%d",sum);
getch();
}
 
Is This Answer Correct ?    13 Yes 10 No
M.sushma
 
  Re: write a program to find the sum of the array elements in c language?
Answer
# 9
/* programm of sum of array value*/
#include<stdio.h>
#include<conio.h>
void main()
{
int array[10],i,sum=0;
for(i=0;i<10;i++)
{
scanf("%d",&array[i];
printf("entered digits are=%d",array[i];
}
sum=sum+array[i]'
for(i=0;i<10;i++)
{
printf("the sum of digits=%d",sum);
}

getch();
}
/*join me on orkut search by name. i will solve your
problem*/
 
Is This Answer Correct ?    12 Yes 8 No
Sumit Aseri
 
  Re: write a program to find the sum of the array elements in c language?
Answer
# 10
//c program of sum array element
#include<stdio.h>
#include<conio.h>
void main()
{
int i,n,sum=0,n,a[100];
clrscr();
printf("How many number are you entering(less than 100) ?");
scanf("%d",&n);
for(i=1;i<=n;i++)
{
scanf("%d",&a[i]);
}
//sum of array element
for(i=1;i<=n;i++)
{
sum=sum+a[i];
}
printf("Sum of your entered number is=%d",sum);
getch();
}//End of main
 
Is This Answer Correct ?    12 Yes 4 No
Rajkumar
 

 
 
 
Other C Interview Questions
 
  Question Asked @ Answers
 
write a program to find the given number is prime or not Accenture 2
do u print this format '(((())))'. This brackets is based on user input like 4 or 5 or 6,without using any loop's? Oracle 1
write aprogram for There is a mobile keypad with numbers 0-9 and alphabets on it. take input of 7 keys and then form a word from the alphabets present on those keys. Subex 1
how to use virual function in real time example CTS 1
find the minimum of three values inputted by the user   3
is forign key will be unique key any table or not?   2
int a=2,b=3,c=4; printf("a=%d,b=%d\n",a,b,c); what is the o/p? Verifone 6
write a c program for print your name .but,your name may be small letter mean print a capital letter or your name may be capital letter mean print a small letter .example \\enter ur name : sankar The name is: SANKAR (or) enter your name:SAnkar The name is:saNKAR   5
main() { float f1=10.5; double db1=10.5 if(f1==db1) printf("a"); else printf("b") } CSC 2
what is the full form of c language Satyam 6
4)What would be the output? main() { int num=425; pf("%d",pf("%d",num)); } a)Comp error b)4425 c)4253 d)3435 e)none   10
plz answer.. a program that takes a string e.g. "345" and returns integer 345   4
 
For more C Interview Questions Click Here 
 
 
 
 
 


   
Copyright Policy  |  Terms of Service  |  Articles  |  Site Map  |  RSS Site Map  |  Contact Us
   
Copyright 2013  ALLInterview.com.  All Rights Reserved.

ALLInterview.com   ::  KalAajKal.com