#include<stdio.h> int main() { int a,n,sum=0; printf("enter the value of n :"); scanf("%d",&n); for(a=n;a>=1;a--) { sum=sum+a; } printf("The sum is :%d",sum); return 0; }
No comments:
Post a Comment