Suppose if the user gave input as 6 then the output will be:
6
5
4
3
2
1
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.. :)#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();
}
Categories:
c program
0 comments:
Post a Comment