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?

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


Please Help Members By Posting Answers For Below Questions

What are the advantage of c language?

1105


What is c programming structure?

1276


What 'lex' does?

1226


What is a void pointer? When is a void pointer used?

1104


What should malloc(0) do? Return a null pointer or a pointer to 0 bytes?

1132


How many levels of pointers have?

1097


Explain the difference between the local variable and global variable in c?

1133


What is c token?

1121


What are the general description for loop statement and available loop types in c?

1166


What is the value of a[3] if integer a[] = {5,4,3,2,1}?

1147


What does %2f mean in c?

1281


How do you search data in a data file using random access method?

1356


Explain how can you tell whether a program was compiled using c versus c++?

1144


What are register variables? What are the advantage of using register variables?

1230


When do you not use the keyword 'return' when defining a function a) Always b) Never c) When the function returns void d) dfd

1127