Hi, welcome to my website Programming.OM. My name is Om prakash kartik. This blog helps you to learn programming languages concepts and technique.
#include<stdio.h> #include<conio.h> void main() { int n,i,sum=0; printf("Enter a number:-"); scanf("%d",&n); for(i=1;i<=n;i++) { sum+=i; } printf("Sum of %d natural numbers = %d",n,sum); getch(); }
0 Comments