Solution:-
#include<conio.h>
#include<stdio.h>
void main ( )
{
int i,n,sum,odd;
clrscr( );
scanf("%d",&n);
sum = 0;
odd = 1;
for(i=1;i<=n;i++)
{
sum=sum+odd;
odd=odd+2;
}
printf("%d\t",sum);
getch( );
}
#include<conio.h>
#include<stdio.h>
void main ( )
{
int i,n,sum,odd;
clrscr( );
scanf("%d",&n);
sum = 0;
odd = 1;
for(i=1;i<=n;i++)
{
sum=sum+odd;
odd=odd+2;
}
printf("%d\t",sum);
getch( );
}