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 |
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?
An emergency vehicle travels 10 miles at a speed of 50 miles per hour. How fast must the vehicle travel on the return trip if the round-trip travel time is to be 20 minutes?
A soldier looses his way in a thick jungle. At random he walks from his camp but mathematically in an interesting fashion. First he walks one mile East then half mile to North. Then 1/4 mile to West, then 1/8 mile to South and so on making a loop. Finally how far he is from his camp and in which direction?
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?
One of the following is my secret word: AIM DUE MOD OAT TIE. With the list in front of you, if I were to tell you any one of secret word, then you would be able to tell the number of my secret word. Which is my secret word?
8 Answers AIM Research, Contata, Exxon Mobil, IBM, TCS, Vernalis Systems,
there r 100 people who buys juice if v take 500 random sample we find 75 people who buys juice then how many random sample they need 2 find remaining 25 buyers
A ship went on a voyage. After it had travelled 180 miles a plane statrted with 10 times the speed of the ship. Find the distance when they meet from starting point.
It comes once in a year and twice in a week what is that?
20 Answers AJ Square Inc, HCL, Infosys,
If one person sends the e-mail to two friends, asking each of them to copy the mail and send it to two of their friends, those in turn send it to two of their friends and so on. How many e-mails would have been sent by the time it did 30 sets?
Which figure should be placed in the empty triangle? 6 7 7 6 8 6 6 ? 2 2 5 3 4 2 5 3
A man is stranded on a desert island. All he has to drink is a 20oz bottle of sprite. To conserve his drink he decides that on the first day he will drink one oz and the refill the bottle back up with water. On the 2nd day he will drink 2oz and refill the bottle. On the 3rd day he will drink 3oz and so on... By the time all the sprite is gone, how much water has he drunk?
Substitute digits for the letters to make the following subtraction problem true. S A N T A - C L A U S ----------------- X M A S Note that the leftmost letter can't be zero in any word. Also, there must be a one-to-one mapping between digits and letters. e.g. if you substitute 3 for the letter M, no other letter can be 3 and all other M in the puzzle must be 3.