#include<stdio.h> int main() { int a,b; int sum=0; int i; printf("how many terms u want to be summed : "); scanf("%d",&a); for(i=1;i<=a;i++){ printf("enter a number : "); scanf("%d",&b); sum+=b; } printf("sum is %d",sum); }
Preview:
downloadDownload PNG
downloadDownload JPEG
downloadDownload SVG
Tip: You can change the style, width & colours of the snippet with the inspect tool before clicking Download!
Click to optimize width for Twitter