program in c to print 1 to 100 without using loop

Answer Posted / praveen

#include<stdio.h>
#include<stdlib.h>
void prav(int);
main()
{
int i=1;
prav(i);
}

void prav(int j)
{
if(j<101)
{printf("%d\n",j);
j++;
prav(j);}

else
exit(0);


}

Is This Answer Correct ?    0 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Why do we use static in c?

636


What is the difference between int main and void main in c?

595


How does sizeof know array size?

634


Why does everyone say not to use gets?

612


Suppose we have a table name EMP as below. We want to perform a operation in which, I want to change name ‘SMITH’ from as ‘SMITH JAIN’. Also I want to change the name of the column from ENAME to E_NAME. EMPNO ENAME JOB MGR HIREDATE SAL 7369 SMITH Coder 7902 17-DEC-80 800 7499 ALLEN SALESMAN 7698 20-FEB-81 1600 7521 WARD SALESMAN 7698 22-FEB-81 1250

1511






Function which gives a pointer to a binary trees const an integer value at each code, return function of all the nodes in binary tree.?

632


Why is it important to memset a variable, immediately after allocating memory to it ?

1557


What is sizeof int?

641


What are valid signatures for the Main function?

703


Which is an example of a structural homology?

790


1) There is a singing competition for children going to be conducted at a local club. Parents have been asked to arrive at least an hour before and register their children’s names with the Program Manager. Whenever a participant registers, the Program Manager has to position the name of the person in a list in alphabet order. Write a program to help the Program Manager do this by placing the name in the right place each time the Program Manger enters a name. The Logic should be written in Data Structures?

1921


What is integer constants?

626


What is difference between structure and union in c programming?

575


What is the use of f in c?

561


What is wrong with this program statement? void = 10;

828