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 is a bucket with lots of marbles. Some are red, some are blue, some are green and some are orange. We don't know the quantity of any. With your closed eyes how many minimum number of marbles you will pick so as to 100% sure that atleast 2 marbles have the same colors.
How many such pairs of letters are there in the word TERMINATE each of which has as many letters between them in the word as in the English alphabet ?
Mrs. Watsherface had a garage sale. A custmer named Gina bought an old lamp and a rug. She paid a total of $5.25 for everything. The rug cost 25 cents more than the lamp. How much did each cost?
Pooja and Esha met each other after long time. In the course of their conversation, Pooja asked Esha her age. Esha replied, "If you reverse my age, you will get my husbund's age. He is of course older than me. Also, the difference between our age is 1/11th of the sum of our age." Can you help out Pooja in finding Esha's age?
how soon can you travel down to start your new job?
Plz mail me some aptitute questions which helps me to face SBI clerical exam.
3 Answers Genpact, State Bank Of India SBI,
In the town called Alibaug, the following facts are true: ? No two inhabitants have exactly the same number of hairs. ? No inhabitants has exactly 2025 hairs. ? There are more inhabitants than there are hairs on the head of any one inhabitants. What is the largest possible number of the inhabitants of Alibaug?
Substitute digits for the letters to make the following addition problem true. W H O S E T E E T H A R E + A S ------------------- S W O R D 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 H, no other letter can be 3 and all other H in the puzzle must be 3.
where will be the handle for a cup?
If a monkey climbes 3mts in 1hr and slips back 2mts. What the time taken to climb 20mts .
On 20 feet high pol a monkey climb/jump 4 feet and every time he fel/slip down 3 feet then, how many jump/climb he reach at top of the pol?
16 Answers Delhi Police, Ellar Infotech, LIC, Syntel,
we have 3 rows 3 columns there in 1st row and 2nd column we have 8 values, so we add from any row or column we get value 15 please tell me how to find out this value