Quiz 2
Quiz 2
2. Name an image editing software in which we can draw and edit images is?
Coral Draw
3. In DOS, Which of the following command is used to delete all the files as well as
sub-directories of a directory?
Deltree
4. The Java compiler translates source code into
Byte code
5. What is the output of the following code if the input string is "CS180"?
Scannerscanner=newScanner();
Stringstr;
str=scanner.next();
System.out.print(str);
The above code fragment does not compile.
6. What is the value of ywhen the code below is executed?
intx=4;
inty=(int)Math.ceil(x%5+x/5.0);
5
7. What is the range of the random number rgenerated by the code below?
intr=(int)(Math.floor(Math.random()*8))+2;
2<=r<=9
8. What will be printed by the code fragment below?
doubleheight=5.5;
if(height>=5.0)
System.out.print("tall");
if(height>=4.0)
System.out.print("average");
if(height>=3.0)
System.out.print("short");
else
System.out.print("veryshort");
tall short
9. What is the value of nafter executing the following code?
intn=20;
switch(n)
{
case10:n=n+1;
case15:n=n+2;
case20:n=n+3;
case25:n=n+4;
case30:n=n+5;
}
ANS : 32
10. What is the value of nafter executing the following code?
intn=20;
intp=n+5;
intq=p10;
intr=2*(pq);
switch(n)
{
casep:n=n+1;
caseq:n=n+2;
caser:n=n+3;
default:n=n+4;
}
This code does not compile.
11. What is the value of variable z after executing the following code?
intx=5;
inty=5;
intz=5;
if(x>3)
if(y>4)
if(z>5)
z+=1;
else
z+=2;
else
z+=3;
z+=4;
11 (ANS)
12. What is the output of the following program?
publicclassTest
{
publicstaticvoidmain(String[]args)
{
privatestaticfinalintvalue=5;
floattotal;
total=value+value/2;
System.out.println(total);
}
}
SyntaxERRORvalueisdeclaredasfinal
13. Which of the following variables contains null?
Stringa;
Stringb=newString();
Stringc="";
Stringd="null";
a (ans)
14. The style rule li, em {color: blue} indicates the content of ____ will appear in blue color.
Both <em> and <li> elements
15. Which protocol is ideal for transmitting large files?
FTP
16. Match each of the TCP/IP layers with the correct protocol.
a) Application Layer 1) IP
b) Transport Layer
2) WiFi
c) Network Layer
3) TCP
d) Physical Layer
4) HTTP
22.
23.
Ctrl + F12
What is place to the left of horizontal scroll bar?
24.
View buttons
Portrait and Landscape are
Page Orientation
interpret HTML
45.
DHCP stands for
Dynamic Host Configurat ion Protocol .
46.
A has a relationship between classes represents _________ and an
is a relationship between classes represent _______.
(containment, inheritance)
47.
A ____ operator is called as de-referencing operator.
(*)
48.
The size of a class with no data members and member functions is
____ bytes.
(1)
49.
A ______ is a function that invokes itself.
(Recursion)
50.
A _______ is a set of instance or values.
(object)
51.
A _______ is a linear list in which additions and deletions take place
ate the same end.
(stack)
52.
new operator allocates memory blocks from the _______.
(Heap)
53. BOSS is developed by
C-DAC
1958
Assembler
57. What is the name of the category of programming languages whose structure is dictated by
the vonNeuman computer architecture?
Imperative
JAVA
FORTRAN
61. What programming language has dominated artificial intelligence programming over the
past 35years?
LISP(List Processing)
JAVA
FORTRAN
64. Structured programming languages are also known as
Modular programming language
65.
32768
71. What will be the output of following program?
void main()
{
int i=20;
printf(%d\n sizeof(i))
}
Ans: 2
72. Every C program should compulsorily have a function called as:
main()
75.
#include<stdio.h>
#define a 5+2
int main()
{
int ans;
ans=a*a*a;
printf(%d ans)
}
ANS: 27
77. Find the output of the following c program?
#include<stdio.h>
{
Int xa=10;
printf(%d%d%d x x++ ++x)
}
ANS: 12 11 11
78.
79.
#include<stdio.h>
int void()
{
return 0;
}
x=2,y=2,z=1
4 bytes
81.
#include<stdio.h>
#include<conio.h>
void main()
{
int p=8,q=20;
if(p==5 && q>5)
printf("\n Why not C");
else
printf("\n Why C");
getch();
}
82.
Why C
Find the output of the following program?
#include<stdio.h>
#include<conio.h>
void main()
{
int j=4,k;
k=!5 &&j;
printf("\n k= %d",k);
}
K= 0
83.
#include<stdio.h>
#include<conio.h>
void main()
{
int i=4;
clrscr();
printf("%d",i);
printf("\n%d",i--);
printf("\n%d",--i);
getch();
}
ANs
84.
#include<stdio.h>
#include<conio.h>
void main()
{
int x=5,y;
y=x++;
printf("%d%d",x,y);
getch();
}
ANS: 6
If(z=100)
Printf(z is 100)
ANS: Mistakes in the equals to operator
86. What is the name of the method used to schedule a thread for execution?
run()
87. Two threads cannot simultaneously enter into the methods of the same object if the
methods are
synchronized
88. ______ is a mechanism for naming and visibility control of a class and its content.
Packages
89. Command to execute a compiled java program is :
java
90. Java uses ___ to represent characters
ASCII code
94. When two processors are employed in a computer, it is known as_______ processing:
parallel processing.
95. The memory that stores the computers date, time, and calendar is the:
CMOS