February 4, 2011

C Program to Print inverse counting from given number till 1 using GOTO

Suppose if the user gave input as 6 then the output will be:
6
5
4
3
2
1


//C Program to Print inverse counting from given number till 1
#include<stdio.h>
#include<conio.h>
void main()
{
int n;
clrscr();
printf(“Enter the no.”);
scanf(“%d”,&n);
while(n!=0)
{
goto s;
s:
{
printf(“\n%d”,n);
n–;
}
}
getch();
}

Hope you liked my posts, give comments if you have any doubts.. :)

Related Posts :



Categories:

0 comments:

Post a Comment

Twitter Delicious Facebook Digg Stumbleupon Favorites More

 
Related Posts with Thumbnails