Write a C program to print 1 2 3 ... 100 without using
loops?

Answer Posted / lakshmipraba

#include<stdio.h>
int i;
void main()
{
if(i<=100)
{
printf("%d ",i);
i++;
main();
}
if(i>100)
exit(0);
}

Is This Answer Correct ?    14 Yes 3 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Is it possible to have a function as a parameter in another function?

600


How do we print only part of a string in c?

587


What is void c?

569


Can you apply link and association interchangeably?

680


Explain what are global variables and explain how do you declare them?

644






What is main return c?

520


Write a program to reverse a string.

643


What is the use of #include in c?

580


What is the right type to use for boolean values in c? Is there a standard type?

567


What is echo in c programming?

559


What is the difference between memcpy and memmove?

606


Explain the difference between #include "..." And #include <...> In c?

634


Can the curly brackets { } be used to enclose a single line of code?

716


How do shell structures work?

570


What are the differences between Structures and Arrays?

612