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

When you call malloc() to allocate memory for a local pointer, do you have to explicitly free() it?

2 Answers   Aloha Technology,


#define FALSE -1 #define TRUE 1 #define NULL 0 main() { if(NULL) puts("NULL"); else if(FALSE) puts("TRUE"); else puts("FALSE"); }

1 Answers  


How will you write a code for accessing the length of an array without assigning it to another variable?

0 Answers  


What is function what are the types of function?

0 Answers  


c language interview questions & answer

0 Answers  


c program to manipulate x=1+3+5+...+n using recursion

2 Answers   Wipro,


If input is 123 then how to print 100 and 20 and 3 seperately?

4 Answers  


Write a program that takes a 5 digit number and calculates 2 power that number and prints it

7 Answers  


how to swap 2 numbers within a single statement?

4 Answers  


write a program to find the given number is prime or not

2 Answers   Accenture, Vasutech,


Synonymous with pointer array a) character array b) ragged array c) multiple array d) none

0 Answers  


What is c definition?

0 Answers  


Categories