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 is the purpose of 'register' keyword in c language?

1018


What is a newline escape sequence?

1097


What are the types of bitwise operator?

1105


Explain what is meant by 'bit masking'?

1190


Why do we use int main?

1092


What is the difference between void main and main in c?

1151


Is it better to use a pointer to navigate an array of values, or is it better to use a subscripted array name?

1081


How does normalization of huge pointer works?

1165


What is the purpose of sprintf() function?

1114


Can you please explain the scope of static variables?

1047


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

2054


What is an lvalue?

1061


What is the difference between arrays and pointers?

1120


What is the function of multilevel pointer in c?

1079


Explain what are the __date__ and __time__ preprocessor commands?

1112