output is:
&&&&&&&
&&&&&
&&&
&
&&&&&
&&&
&
|
Light Poster
|
|
| 12Aug2008,16:52 | #1 |
|
Write program using loops to produce the following output.
output is: &&&&&&&
&&&&& &&& & |
|
Go4Expert Founder
|
![]() |
| 12Aug2008,20:48 | #2 |
|
Do it yourself
|
|
Go4Expert Member
|
|
| 13Aug2008,12:30 | #3 |
|
.
. . . int i=10; int j=0; while(j<i){ while(i>0) { cout<<"&"; i--; } j++; }[PHP] |
|
Skilled contributor
|
|
| 13Aug2008,13:28 | #4 |
|
lolzzzz
|
|
Mentor
|
![]() |
| 13Aug2008,14:55 | #5 |
|
Here you go. I've indented it to make it easy to see what's going on:
Code:
int main()
{
char *str01="I'm a cheating smeghead!!!\0ebahhhaagfaaghhfhfgfiehdhihbadijidgjhbhchchbheahabae";
for (int i='a';i<='z'; putchar
(
(
str01[i-'a']+(25-i+2*'a')+
i-'a'-116-(((str01+27)
[
(i-'a')*2]-'a')*10+((str01+27)[(i-'a')*2+1
]
-'a')))=='#'?10:(str01[i-'a'
]
+(25-i+2*'a')+i-'a'-116-(((str01+27)
[
(i-'a')*2]-'a')*10+((str01+27)[(i-'a')*2+1
]
-'a')))
)
)
i++;}
|
|
Mentor
|
![]() |
| 13Aug2008,15:00 | #6 |
|
Hmm, it probably won't work as is; I can't seem to shift those two spaces from the middle of str01. Shabbir, does the forum split long words? If so how about NOT doing that in code blocks?
str01 after the zero should be "ebahh haagf aaghh fhfgf iehdh ihbad ijidg jhbhc hchbh eahab ae", with spaces inserted after every five for the forum's benefit; remove these extra spaces before running the program otherwise it just won't work. |
|
Skilled contributor
|
|
| 13Aug2008,15:32 | #7 |
|
Light Poster
|
|
| 14Aug2008,15:55 | #8 |
|
Thanx a lot
|
|
Skilled contributor
|
|
| 14Aug2008,20:32 | #9 |
|
U wellcome,
but suggestion to u, u have to try with simple coding. |
|
Mentor
|
![]() |
| 14Aug2008,20:48 | #10 |
|
mmm, but why bother if you're going to do his homework for him anyway?
|