AD1

Sunday, 5 February 2017

No loops

Write a C program to print the numbers from 1 to 10 without using any looping statements (for/while/do while)
also do not write printf() 10 times


#include <stdio.h>
int main()
{
static unsigned int counter=1;
if(counter<=10)
{
printf("%d\t",counter);
counter++;
main();
}
return 0;
}
view raw noloop.c hosted with ❤ by GitHub

No comments:

Post a Comment