#include <stdio.h> int main() { int i,a,c=0; printf("enter a num \n"); scanf("%d",& a); for(i=1; i<a*2; ++i) { if(i%2!=0) { c+=i; } } printf("%d\n",c); return 0; }
To embed this project on your website, copy the following code and paste it into your website's HTML: