#include"stdio.h" #include"conio.h" void main() { int i,n,a,sum=0; printf("Enter n no. values: "); scanf("%d",&n); printf("\nEnter values: "); for(i=1;i<=n;i++) { scanf("%d",&a); sum=sum+a; } printf("\n Sum of %d is= %d",n,sum); getch(); }
Post a Comment
No comments:
Post a Comment