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


Please Help Members By Posting Answers For Below Questions

Why void main is used in c?

560


What do you mean by a sequential access file?

630


How can I avoid the abort, retry, fail messages?

664


Why is c used in embedded systems?

614


What is pointers in c with example?

584






Explain 'bus error'?

564


When should you not use a type cast?

661


What is the difference between c &c++?

648


What is selection sort in c?

612


How can I display a percentage-done indication that updates itself in place, or show one of those twirling baton progress indicators?

583


What is the deal on sprintf_s return value?

646


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

649


How important is structure in life?

594


Why pointers are used?

633


What does c value mean?

630