Search This Blog

C Program Print A To Z Using For Loop

C Program Print A To Z Using For Loop :
//C Program Print A To Z Using For Loop

#include<stdio.h>
#include<conio.h>
void main()
{
int i;
clrscr();
printf("\n Print A To Z Using For Loop\n\n");
for(i=65; i<=90; i++)
{
printf(" %c",i);
}
getch();
}
OUTPUT
C Program Print A To Z Using For Loop

C Program Find Sum Of First 100 Natural Numbers

C Program Find Sum Of First 100 Natural Numbers :
//C Program Find Sum Of First 100 Natural Numbers

#include<stdio.h>
#include<conio.h>
void main()
{
int i,sum,temp;
clrscr();
sum=0;
temp=1;
for( i=0; i<100; i++ )
{
sum =sum+temp;
temp =temp+1;
}
printf("\n Natural Numbers= %d",sum);
getch();
}
OUTPUT
C Program Find Sum Of First 100 Natural Numbers