do u print this format '(((())))'. This brackets is based on
user input like 4 or 5 or 6,without using any loop's?
Answer Posted / ashutosh tiwari
int r;
Void main()
{
scanf("%d",&r);
fun();
}
void fun()
{
static int t = r;
printf("(");
if(--t != 0)
fun();
printf(")");
}
OR
void main()
{
int r,i;
scanf("%d",&r);
i=r;
repeat1:
if(i != 0)
{
printf("(");
i--;
goto repeat1;
}
i=r;
repeat2:
if(i != 0)
{
printf(")");
i--;
goto repeat2;
}
}
Is This Answer Correct ? | 11 Yes | 2 No |
Post New Answer View All Answers
Why isn't any of this standardized in c? Any real program has to do some of these things.
any function have arguments one or more OR not . it is compulsary a) any function compulsary have one or more arguments b) any function did not have arguments. It is not compulsary c) it is optional it is not compulsary d) none of the above
What does double pointer mean in c?
What is difference between array and structure in c?
Write a code to determine the total number of stops an elevator would take to serve N number of people.
What is a void pointer? When is a void pointer used?
Can stdout be forced to print somewhere other than the screen?
Explain built-in function?
What is gets() function?
Are there constructors in c?
How can I recover the file name given an open stream or file descriptor?
Explain how do you generate random numbers in c?
Is main is a keyword in c?
Why c language?
What does int main () mean?