I want to print a statement n
times without using a loop.
#include<stdio.h>
#include<conio.h>
void show(char *n,int count);
void main()
{
int x=10;
char name[20]="zeeshann";
clrscr();
show (name,10);
getch();
}
void show(char *n,int count)
{
while(count>0)
{
printf("%s\n",n);
count--;
}
}
This is my code where I am printing a string 10 number of time using a while loop.
How can print it 10 number of time without using while
or any loop?
printf
10 times, but please don't do that).void main()
That is not a valid signature formain()
(although some non-compliant compilers will allow it.) The only valid signatures are:int main( void )
andint main( int argc, char *argv[] )