Write a C program to print the addition of the five values
#include <stdio.h> #include<conio.h> void main() { int a[5],sum=0,i; clrscr(); printf("enter five values"); for(i=0;i<=4;i++) { scanf("%d",&a[i]); sum+=a[i]; } printf("the sum of given numbers is %d",sum); getch(); }
OUTPUT:
enter five values3 90 190 7937 2889 the sum of given numbers is 11109 Process finished.
No comments:
Post a Comment