Without using any loops print {{{}}} (u cant use
goto,for,while etc..).
Answers were Sorted based on User's Feedback
Answer / ankita shukla
#include<stdio.h>
#include<conio.h>
void main()
{
clrscr();
printf("{{{}}}");
getch();
}
| Is This Answer Correct ? | 24 Yes | 2 No |
Answer / jaydeep
#include<iostream>
using namespace std;
class CSomeClass
{
public:
CSomeClass()
{
cout<<"{";
}
~CSomeClass()
{
cout<<"}";
}
};
int main()
{
CSomeClass SomeObjects[3];
return 0;
}
| Is This Answer Correct ? | 16 Yes | 0 No |
Answer / siddarth pillai
public class TestRec
{
public static void main(String args[])
{
String Shape = " ";
int num = 3;
int count = 0;
Display(num,count,Shape);
}
public static void Display(int num,int count,String Shape)
{
if(count < num)
{
Shape = "{"+Shape+"}";
count++;
Display(num,count,Shape);
}
else
System.out.println(Shape);
}
}
| Is This Answer Correct ? | 5 Yes | 1 No |
Answer / jeevan
Use recursive function for this
in example example user has entered 3
(Code is written in VB)
Num = 3
Itt = 0
ListPR = ""
Function PrintPra(ListPR as String,Itt as integer)
if Itt < 3 then
ListPR = "{" & ListPR "}"
itt = itt +1
'Call the Function again
PrintPra(ListPR,Itt)
else
Print ListPR
end
End if
End function
| Is This Answer Correct ? | 6 Yes | 3 No |
There are 9 coins. Out of which one is odd one i.e weight is less or more. How many iterations of weighing are required to find odd coin?
I'm 11 letters word & a famous place in India,letters 6,7,8,9,10,11 is a fruitand 6,7,5,3 a part of face,6238 a geometrical shape.783 a bird.find me
11 Answers ACC, Raisoni, Tech Mahindra,
x^y+y^x=5298.If x and y are integers find x and y.
what is the main reason to ask this type question in your interview sir?
Montu, Bantu, Chantu and Pintu have pets. Montu says, "If Pintu and I each have a dog, then exactly one of Bantu and Chantu has a dog." Bantu says, "If Chantu and I each have a cat, then exactly one of Montu and Pintu has a dog." Chantu says, "If Montu and I each have a dog, then exactly one of Bantu and Pintu has a cat." Pintu says, "If Bantu and I each have a cat, then exactly one of Bantu and I has a dog." Only one of the four is telling the truth. Who is telling the truth?
There are 25 horses and five tracks. There is no stop clock and we have to find the top 5 horses in the bunch. What is the minimum possible races ?
In Mr. Mehta's family, there are one grandfather, one grandmother, two fathers, two mothers, one father-in-law, one mother-in-law, four children, three grandchildren, one brother, two sisters, two sons, two daughters and one daughter-in-law. How many members are there in Mr. Mehta's family? Give minimal possible answer.
There are 3 ants at 3 corners of a triangle, they randomly start moving towards another corner. What is the probability that they don't collide?
Two trains at speed 60 km/hr comes in the opposite direction. At a particular time the distance between the two trains is 18km. A shuttle flies between the trains at the speed of 80 km/hr. At the time the two trains crashes what is the distance traveled by shuttle?
Two identical pack of cards A and B are shuffled throughly. One card is picked from A and shuffled with B. The top card from pack A is turned up. If this is the Queen of Hearts, what are the chances that the top card in B will be the King of Hearts?
Everyday in his business a merchant had to weigh amounts from 1 kg to 121 kgs, to the nearest kg. What are the minimum number of different weights required and how heavy should they be?
Five friends with surname Batliwala, Pocketwala, Talawala, Chunawala and Natakwala have their first name and middle name as follow. 1. Four of them have a first and middle name of Paresh. 2. Three of them have a first and middle name of Kamlesh. 3. Two of them have a first and middle name of Naresh. 4. One of them have a first and middle name of Elesh. 5. Pocketwala and Talawala, either both are named Kamlesh or neither is named Kamlesh. 6. Either Batliwala and Pocketwala both are named Naresh or Talawala and Chunawala both are named Naresh. 7. Chunawala and Natakwala are not both named Paresh. Who is named Elesh?