- 4
plz solve this , i hv only half an hout to solve 7 questions asked in an i interview
public class MyClass { public static void main(String[] args) { for (int a = 1; a <= 5; a++) { for (int b = 1; b <= a; b++) { System.out.print(a); // this statement prints to the screen } System.out.println(); // this statement prints to the screen } } }
6 Respostas
+ 6
If you need to ask Internet strangers to solve your interview questions, you're in the wrong interview...
+ 2
Are you really in a PROGRAMMING INTERVIEW while you're asking some simple questions in a forum?
+ 1
javascript
var a = 1;
var b = 2;
var c = 3;
if (a > b){
if (b > c){
document.write(a);
}
elseif (b > a){
if (b > c){
document.write (b);
}
else {
document.write(c);
}
+ 1
or
var a = 1;
var b = 2;
var c = 3;
var max = a;
if (b > max){ b = max;}
if (c > max){ c = max;}
document.write(max);
0
1
22
333
4444
55555
- 4
Question 2: Write some code, using a programming language or scripting language with which you are familiar, that will compare 3 numbers and print the largest number to the screen. For this question, please write the code to the best of your ability and do not write pseudo-code. Please fill in the line below stating what programming/scripting language you are using to answer this question.
Programming/Scripting Language Used:_____________________
Your Code: