Translate

Friday, 21 March 2014

Make A simple increment number program through Turbo c ++

Source Code :

#include<stdio.h>
#include<conio.h>
void main(void)
{
int a;
clrscr();
a=1;
printf("The original value of a : %d",a);
a++;
printf("\nThe first increment : %d", a);
a++;
printf("\nThe second increment : %d", a);
a++;
printf("\nThe third increment : %d", a);
a++;
printf("\nThe fourth increment : %d", a);
getch();
}

The increment factor used here is a++ , which auto assign the original value of a with a +1 addition,in each line the value of a gets and increment by 1, because of the statement a++
and the we can print the increment in each line ..
here is the sample of what the program looks like 




No comments:

Post a Comment