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 clrscr is used in c?

577


The number of bytes of storage occupied by short, int and long are a) 2, 2 and 4 b) 2, 4 and 4 c) 4, 4 and 4 d) none

759


which type of aspect you want from the student.

1699


c programs are converted into machine language with the help of a) an interpreter b) a compiler c) an operatinf system d) none of the above

725


hi send me sample aptitude papers of cts?

1650






Does c have function or method?

585


Why header files are used?

642


When should the volatile modifier be used?

677


All technical questions

1505


any restrictions have on the number of 'return' statements that may be present in a function. a) no restriction b) only 2 return statements c) only 1 return statements d) none of the above

650


Explain how can I write functions that take a variable number of arguments?

608


Why is this loop always executing once?

615


How to write a code for implementing my own printf() and scanf().... Please hep me in this... I need a guidance... Can you give an coding for c... Please also explain about the header files used other than #include...

4900


What is external variable in c?

607


What are different types of operators?

592