Observe the following coding in qbasic :--
FOR I=1 TO 5
FOR J=1 TO 5
IF (I=J) OR (I+J=6) THEN
PRINT "*";
ELSE
PRINT " ";
END IF
NEXT J,I
The output will produce a structure that looks like a letter in the English alphabet! Can you find the letter?
This section requires Javascript.
You are seeing this because something didn't load right. We suggest you, (a) try
refreshing the page, (b) enabling javascript if it is disabled on your browser and,
finally, (c)
loading the
non-javascript version of this page
. We're sorry about the hassle.
We should all get the points back that we lost from trying this...
True and I assumed he added a new line character and then gave the answer as X. But flimsy code, real flimsy and careless.
I got it soo right !! well this structure we had it last year at the final exams
True same views are mine
1
What
what is schudeling
hmmmm difficult
So easy, you must to a newline @ each iteration w
X
i think the output will be like this /
Yeah, you're right, but there is no "none of the the above" or "no letter would form" choice... But if you would just ASSUME that there is, X is the one.
* * * * * * * * ie exact output,not any char
i kind of guessed that the line printf("\n"); was missing lol :)
thats what I was thinking, and drew a straight line for the first time.........
Could solve it just by watching the pattern...
if i==j then print "*", that means a * at exact center,
and (i+j)=6 means if i=4, j=2 then *... j=4 and i=2... then *... So its kind of symmetrical for me... so X was obvious...
No new line char is there....So X will not printed...if there is any new line char after j-th loop then X Char printed.......
lol i just guessed it!
Definitely at the end of the program when it reached six tries it will give an output of an asterisk where letter X is the most proximate figure when it comes to the letters in the alphabet.
If we assume that there is a new line character (Which is not there in the question!!) the solution may lead to X...
i think its print blank space
I thought there should be a newline?
new line has to assumed then X will be printed
where is the new line character??????
The answer is X but the code is not proper since we have to assume a new line character.
"Run" it on paper and receive letter 'X' :)
just simply use paper run them and get the answer
hy
considering that there is new line character the only pattern that can form is X else the answer will be none of the given options if we consider new line character
agreed
yes x is the answer
the output should be the x
simple dry run can help solve the problem
There's no return to line after the second loop is done. So the output won't be an X, the output will be on one line.
the output will be x in the form of * because the looping condition are in such a way thats why
The output will look like 000 0 0 0 00 00 0 0 0 *000
Will Print X. The first loop prints 5 rows and the 2nd will print the stars when the conditions mentioned are satisfied So "*" would be printed when... X,Y(1,1), X,Y(1,5) X,Y(2,2) X,Y(2,4) and so on...
THIS could be Right I Think
the output could be X.
yes it should be X as i+j=6 & i=j
No, answer will not be X. there is no newline character then how control will go to new line. that's why output will be in single line. and X will not form
X is the answer
Problem Loading...
Note Loading...
Set Loading...
There is no newline character so, X will not form. X is possible only when there is newline character. Output will be in single line.