# Geometric Limited C++/ Java Interview Questions 01 June 2012

Posted on :09-03-2016

Q1. Find the error in the following program function?

f()
{ int a;
void c;
f2(&c,&a);}

a) Error
b) No output
c) void cant be passed by reference
d) None of the above

Q2. Answer the following questions below?

a=0;
b= (a=0)? 2:3;

a) What will be the value of b?

i) 2
ii) 3
iii) 0
iv) None of the above

b) If in first statement a=0 is replaced by a = -1, b=?

i) 2
ii) 3
iii) Error
iv) None of the above

c) If in second statement a=0 is replaced by a = -1, b=?

i) 2
ii) 3
iii) Error
iv) None of the above

Q3. Explain the statements in the given code?

char *a[2];
int const *p;
int *const p;
struct new { int a;int b; *var[5] (struct new)}

Q4. Find the value of c in the given function?

f()
{
int a=2;
f1(a++);
}
f1(int c)
{printf("%d", c);}

a) 2
b) Garbage value
c) 3
d) None

Q5. What is the value of c in the given function?

f1()
{
f(3);
}
f(int t)
{
switch(t);
{
case 2: d=3;
case 3: d=4;
case 4: d=5;
case 5: d=6;
default: d=0;
}

a) 3
b) 4
c) 5
d) 0
e) 6

Q6. What is the error in the following program function?

int *f1()
{
int a=5;
return &a;
}
f()
int *b=f1()
int c=*b;
}

a) pointers are not correctly used
b) return statement is not used correctly
c) function is not in the main
d) function is non-executable

Q7. Which one is correct when a pointer to a function returns a integer pointer?

a) Function returning an int pointer
b) Function pointer returning an int pointer
c) Function pointer returning an array of integers
d) Array of function pointer returning an array of integers

Q8. Find the error in the following program segment?

int a;
short b;
b=a;

a) int cant be equal to short
b) equality operator cant be used
c) cant convert long to short
d) None of the above

Q9. What is a function? What are the different arguments that a function can contain?

Q10. What is the character set used in JAVA 2.0?

a) Unicode
b) UTF-8
c) ISO-8869-1
d) UTF-16

FreshersLive - No.1 Job site in India. Here you can find latest 2020 government as well as private job recruitment notifications for different posts vacancies in India. Get top company jobs for both fresher and experienced. Job Seekers can get useful interview tips, resume services & interview Question and answer. Practice online test free which is helpful for interview preparation. Register with us to get latest employment news/rojgar samachar notifications. Also get latest free govt and other sarkari naukri job alerts daily through E-mail.

 ✖