do u print this format '(((())))'. This brackets is based on
user input like 4 or 5 or 6,without using any loop's?
Answer / 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 |
How to calculate Total working time using Login and logout?
2 Answers CTS, Cygnus, Infosys, Signal Networks, TCS, Wipro,
I didn't count the ducks that I saw in line, but I do remember that one duck was in front of two ducks, another duck behind two ducks. How many ducks did I see?
What are the modifiers available in c programming language?
#include<stdio.h> void main() { char *str; long unsigned int add; str="Hello C"; add=&str[0]; printf("%c",add); } What is the output?
Bit swapping
What is C language Terminator?
How can I pad a string to a known length?
What is const volatile variable in c?
what is the coding of display the factorial of a number using array and function?
a=0; b=(a=0)?2:3; a) What will be the value of b? why b) If in 1st stmt a=0 is replaced by -1, b=? c) If in second stmt a=0 is replaced by -1, b=?
What is function definition in c?
How can I prevent other programmers from violating encapsulation by seeing the private parts of my class?