/* To Calculate a number in the following manner
    1 + 5 + 9 + ........................+ n
    and sum of the following series         */

#include<stdio.h>
#include<conio.h>
#include<math.h>
main()
{
	int i,count,sum,n;
	clrscr();
	printf("Enter how many numbers to be printed\n");
	scanf("%d",&n);
	for(i=1,count=0,sum=0;count<n;count++,i+=4)
		sum=sum + i;
	    printf("%d",sum);
	getch();
}

/* input : 4
   output: 28  ie: (1+5+9+13)
   Exercise 1: sum of the following series 1^2 + 5^2 + 9^2 +.............
*/