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 |
A thief steals half the total no of loaves of bread plus 1/2 loaf from a bakery. A second thief steals half the remaining no of loaves plus 1/2 loaf and so on. After the 5th thief has stolen there are no more loaves left in the bakery. What was the total no of loaves did the bakery have at the beginning
4 Answers Allianz, Essar, L&T, Misys, Wipro,
there are 5 ppl's in a circle all must wear hat either white or black 1st condition: atleast 2 must wear white 2nd condition: atleast 2 must wear black 3rd: they should not talk each with other Question: How they come to know which colour of hat they are wearing
A husband and wife have a combined age of 91. The husband is now twice as old as his wife was when he was as old as she is now. How old is wife?
Tanya wants to go on a date and prefers her date to be tall, dark and handsome. 1. Of the preferred traits - tall, dark and handsome - no two of Adam, Bond, Cruz and Dumbo have the same number. 2. Only Adam or Dumbo is tall and fair. 3. Only Bond or Cruz is short and handsome. 4. Adam and Cruz are either both tall or both short. 5. Bond and Dumbo are either both dark or both fair. Who is Tanya's date?
Arrange five planets such that 4 of them add up to 5th planet numerically. Each of the letters of the planet should represent a unique number from the range 0 - 9. You have to use all ten digits. There is an amazing mathematical relationship exists among the names of the planet.
sir i need catholic syrian bank previous question papers fully. it will be helpful for me to greater extend .please do the needful to me.
2-3 ques on GDP growth rate ?
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.
Can u pl send me the model question paper or previous 5 year question paper for South Indian Bank's clericl post.Pl do send it to my mailId:nan_april4@yahoo.co.in
how many coins do i have in my pocket
Sachin, Dravid and Ganguly played in a Cricket match between India and England. ? None of them scored more than 99 runs. ? If you add the digits of the runs scored by Sachin to his own score, you will get the runs scored by Dravid. ? If you reverse the digits of the runs scored by Dravid, you will get the runs scored by Ganguly. ? The total runs scored by them is 240. Can you figure out their individual scores?
In rail road there are some stations. Each station should have tickets to all other stations.If they add some new stations they need 46 more tickets.How many stations are there before and after adding the stations?