Developer community
0 votes
33 views
asked by | 33 views

1 Answer

0 votes
Best answer
 #include<stdio.h>  
 #include<conio.h>  
  void main()  
  {  
  int a[10],sum=0;  
  int *j;  
  int i,n;  
  clrscr();  
  printf("How many elements you want to add:");  
  scanf("%d",&n);  
  printf("Enter element:");  
  for(i=0;i<n;i++)  
  {  
  scanf("%d",&a[i]);  
  }  
  j=&a[0];  
  for(i=0;i<n;i++)  
    {  
     sum=sum+*j;  
     j++;  
    }  
  printf("sum=%d",sum);  
 }
answered by

Related questions

0 votes
1 answer
0 votes
1 answer
asked by keem Expert (13.2k points) 29 44 62 | 33.5k views
+1 vote
3 answers
asked by Smita Advisor (7.1k points) 11 23 42 | 6.8k views
Quick search syntax
tags tag:apple
author user:martin
title title:apple
content content:apple
exclude -tag:apple
force match +apple
views views:100
score score:10
answers answers:2
is accepted isaccepted:true
is closed isclosed:true

Categories


C Books Guide and List
C++ Books Guide and List
Best Java Books

3.8k questions

4k answers

117 comments

10.7k users

3,754 questions
4,046 answers
117 comments
10,709 users