jituTechnology

jituTechnology

write a program to find the sum of first n odd integers.

Here is the c source code/program for: write a program to find the sum of first n odd integers.

/* write a program to add first seven series using for loop
programmed by:
Name: Jitendra kumar Yadav
Roll: 16
Date: 12 feb 2011 */
#include <stdio.h>
#include <conio.h>
void main()
{
     int sum=0;
   int i,n;
   printf(“Enter the term: “);
   scanf(“%d”,&n);
   for(i=1; i<=n; i=i+2)
     {
           sum=sum+i;
     }
      printf(“the sum of odd numbers is %d”,sum);
     getch();
}

No comments yet.

Add a comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.



Connect with Me

GPO 8973 NPC 541; Kathmandu Nepal
Phone: +977 9851236800

Calendar

January 2026
S M T W T F S
 123
45678910
11121314151617
18192021222324
25262728293031