program in c to print 1 to 100 without using loop
Answer Posted / gadigebhasker
void otoh(int,int);
void main()
{
int x,y;
printf("enter initial value x & y final value\n");
scanf("%d%d",&x,&y);
printf("0 to 100 number\n");
otoh(x,y);
getch();
}
void otoh(int a,int i)
{
if(a<=i)
{
printf("%d\t",a++);
otoh(a,i);
}
else
printf("END");
}
Is This Answer Correct ? | 27 Yes | 4 No |
Post New Answer View All Answers
Why void main is used in c?
What do you mean by a sequential access file?
How can I avoid the abort, retry, fail messages?
Why is c used in embedded systems?
What is pointers in c with example?
Explain 'bus error'?
When should you not use a type cast?
What is the difference between c &c++?
What is selection sort in c?
How can I display a percentage-done indication that updates itself in place, or show one of those twirling baton progress indicators?
What is the deal on sprintf_s return value?
An integer that indentifies the position of a data item in a sequence of data items a) value b) number c) index d) all of the above
How important is structure in life?
Why pointers are used?
What does c value mean?