About Me

My photo
Raipur, Chhattisgarh, India
Hi , I am Amit Thakur. I have worked as a QA Engineer for two years and as a Java Developer for one year in NIHILENT TECHNOLOGIES PVT. LTD., Pune.Currently I am working as DEAN (Research & Development) in Bhilai Institute of Technology, Raipur.

Saturday, August 31, 2013

C Program To Print First 10 Natural Numbers

C Program to print first 10 Natural Numbers without using Conditional Loop
Using For Loop
#include
#include
void main()
{
int i=1;
clrscr();
for(i=1;i<=10;i++)
  printf("%d",i);
getch();
}

Using While Loop
#include
#include
void main()
{
int i=1;
clrscr();
while(i<=10)
  {
  printf("%d",i);
  i++;
  }
getch();
}

Using Do-While Loop
#include
#include
void main()
{
int i=1;
clrscr();
do{
  printf("%d",i);
  i++;
  }while(i<=10);
getch();
}

3 comments:

Pankaj Prakash said...

#Passionate about #Programming #Coding #Solving programming problems visit here
Code For Win

Pankaj Prakash said...
This comment has been removed by the author.
Unknown said...

Thank you 👌👌