My Subject Blog

C Program Odd Number Series

/* Write a program for following Series:  1 + 3 + 5 +… + n   */

#include <stdio.h>

int main(void) {
int n;
printf("Enter Value of n :");
scanf("%d",&n);
printf(" Total Sum = %d",(n*n));
return 0;
}

Comments

Most Visited Post

C Program to Find Largest Odd Number from Array

Followers