#include<stdio.h>//header file
#include<conio.h>//header file
void main() //starting of the main() function
{
int s=0,i,n,c; //declaration of the variables
clrscr();
printf("program that calculates the sum of odd nos.");
printf("\n\n\n\t\t------------INPUT-------------");
printf("\n\nenter the range");//taking input from the user
scanf("%d",&n);
c=(2*n)-1;
for(i=1;i<=c;i=i+2)
s=s+i;
printf("\n\n\n\t\t------------OUTPUT------------");
printf("\n\nthe sum of the odd nos.=%d",s);//printing output
getch();
}