Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...


do u print this format '(((())))'. This brackets is based on
user input like 4 or 5 or 6,without using any loop's?



do u print this format '(((())))'. This brackets is based on user input like 4 or 5 or 6,..

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

Post New Answer

More C Interview Questions

Explain how to reverse singly link list.

0 Answers  


write a c/c++ program that takes a 5 digit number and calculates 2 power that number and prints it?

4 Answers  


What are volatile variables in c?

0 Answers  


When should you use a type cast?

0 Answers  


Write one statement equalent to the following two statements x=sqr(a); return(x); Choose from one of the alternatives a.return(sqr(a)); b.printf("sqr(a)"); c.return(a*a*a); d.printf("%d",sqr(a));

6 Answers   TCS,


What is the ANSI C Standard?

0 Answers   Celstream,


How can I pad a string to a known length?

0 Answers  


What is the size of array float a(10)?

0 Answers  


Explain about the constants which help in debugging?

0 Answers  


What are the key features of C?

6 Answers  


What will be the output of x++ + ++x?

20 Answers   MBT, Religare,


What is meaning of tree

0 Answers  


Categories