Program to find Sum of ODD Number From 1 to N January 01, 2018 Programing In C No comments #include<conio.h> #include<stdio.h> void main() { int sum,m,n,l; clrscr(); printf("Enter the value of N"); scanf("%d",&l); m=l+1; n=m/2; sum=n*n; printf("Sum of odd numbers from 1 to N=%d",sum); getch(); } Output Enter the value of N=9 25 Enter the value of N=11 36 Share This: Facebook Twitter Google+ Stumble Digg Email ThisBlogThis!Share to XShare to Facebook
0 comments:
Post a Comment