Technical Test

What will be output if you will compile and execute the

following c code?

#include<stdio.h>

int main(){

int i=320;

char *ptr=(char *)&i;

printf("%d",*ptr);

return 0;


What will be output if you will compile and execute the

following c code?

#include<stdio.h>

#define x 5+2

int main(){

int i;

i=x*x*x;

printf("%d",i);

return 0;

}


What will be output if you will compile and execute the

following c code?

#include<stdio.h>

int main(){

char c=125;

c=c+10;

printf("%d",c);

return 0;

}


What will be output if you will compile and execute the

following c code?

#include<stdio.h>

int main(){

float a=5.2;

if(a==5.2)

printf("Equal");

else if(a<5.2)

printf("Less than");

else

printf("Greater than");

return 0;

}


What will be output if you will compile and execute the

following c code?

#include<stdio.h>

int main(){

int i=4,x;

x=++i + ++i + ++i;

printf("%d",x);

return 0;

}


What will be output if you will compile and execute the

following c code?

#include<stdio.h>

int main(){

int a=10;

printf("%d %d %d",a,a++,++a);

return 0;


What will be output if you will compile and execute the

following c code?

#include<stdio.h>

int main(){

char *str="Hello world";

printf("%d",printf("%s",str));

return 0;

}


What will be output if you will compile and execute the

following c code?

#include <stdio.h>

#include <string.h>

int main(){

char *str=NULL;

strcpy(str,"cquestionbank");

printf("%s",str);

return 0;

}


What will be output if you will compile and execute the

following c code?

#include <stdio.h>

#include <string.h>

int main(){

int i=0;

for(;i<=2;)

printf(" %d",++i);

return 0;

}


What will be output if you will compile and execute the

following c code?

#include<stdio.h>

int main(){

int x;

for(x=1;x<=5;x++);

printf("%d",x);

return 0;

}


Consider the following program:

import myLibrary.*;

public class ShowSomeClass

{

// code for the class...

}

What is the name of the java file containing this program?


Which of the following is TRUE?


Consider the following code snippet

String river = new String(“Columbia”);

System.out.println(river.length());

What is printed?


What is different between a Java applet and a Java application?


Consider

public class MyClass{

public MyClass(){/*code*/}

// more code...

}

To instantiate MyClass, you would write?


What is garbage collection in the context of Java?


A constructor


Which of the following may be part of a class definition?


What is byte code in the context of Java?


You read the following statement in a Java program that compiles and

executes.

submarine.dive(depth);

What can you say for sure?


Given the following code fragment:

int A[];

int i = 0;

A = new int A[4];

while (i < 4)

{

A[i] = 10;

i = i + 1;

}

What is the value of A[3]?




















































































































































































































































































Description:

This is a multiple choice test.
Click the Start Test button below to start.
A question and the possible answer choices appear. Select the choice you find to be the correct answer of the question. Clicking on a choice saves it as your answer for the question.
Use Next and Back buttons to move on to the next or previous question in the test.
There is no negative marking for wrong choices selected.
After you finish the test, click on the End Test button to submit your test and see your scorecard.
You can review your answer also.

Discussion

Thu Thu

IT

612 days 8 hours 16 minutes ago

Parvin Farshchi

How the online UN technical test are conducted?

1867 days 1 hours 2 minutes ago

8 Followers
Tests: 2

Your Facebook Friends on WizIQ

More Tests By Author

Aptitude Test
21 Questions | 30171 Attempts