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
What is the purpose of 'register' keyword in c language?
What is a newline escape sequence?
What are the types of bitwise operator?
Explain what is meant by 'bit masking'?
Why do we use int main?
What is the difference between void main and main in c?
Is it better to use a pointer to navigate an array of values, or is it better to use a subscripted array name?
How does normalization of huge pointer works?
What is the purpose of sprintf() function?
Can you please explain the scope of static variables?
which of the following is not a character constant a) 'thank you' b) 'enter values of p, n ,r' c) '23.56E-o3' d) all of the above
What is an lvalue?
What is the difference between arrays and pointers?
What is the function of multilevel pointer in c?
Explain what are the __date__ and __time__ preprocessor commands?