## Interview Question

Country: India

Comment hidden because of low score. Click to expand.
3
of 5 vote

#define square(X) X*X is a MACRO(google it)
and compiler replace the macro with defination
so code become
sq= X*X in our code X is 2+3 so it become 2+3*2+3
so ans=11

Comment hidden because of low score. Click to expand.
0
of 0 vote

#define square(X) X*X is a MACRO(google it)
and compiler replace the macro with defination
so code become
sq= X*X in our code X is 2+3 so it become 2+3*2+3
so ans=11

Comment hidden because of low score. Click to expand.
0
of 0 vote

#define square(X) X*X is a MACRO(google it)
and compiler replace the macro with defination
so code become
sq= X*X in our code X is 2+3 so it become 2+3*2+3
so ans=11

Comment hidden because of low score. Click to expand.
0
of 0 vote

What is the output of the following code?
#include<stdio.h>
void main ( )
{
int s=0;
while (s++<10)
{
if(s<4&&s<9)
continue;
printf(“ %d/t”,s);
}
}

Comment hidden because of low score. Click to expand.
0

answer will be 4 5 6 7 8 9 10

Comment hidden because of low score. Click to expand.
0
of 0 vote

output will be 1 2 3 4

Comment hidden because of low score. Click to expand.
0

it will rather be 1 2 3 4 5 6 7 8 9 10

Comment hidden because of low score. Click to expand.
0
of 0 vote

int x = 0; for (x=1; x<4; x++); printf("x=%d\n", x);
What will be printed when the sample code above is executed?

Comment hidden because of low score. Click to expand.
0

Comment hidden because of low score. Click to expand.
0
of 0 vote

#define square(v) v*v
Void main()
{
int p=3,s;
s=square(++3);
}
OUTPUT
25
Please explain the macro how the variable incremented....

Comment hidden because of low score. Click to expand.
0

Macro just replaces the values so we get
++3 * ++3 (pre increment first increments and then assign)

Comment hidden because of low score. Click to expand.
0
of 0 vote

For2+3*2+3

Comment hidden because of low score. Click to expand.
0
of 0 vote

#define SQUARE (X)X*X
Void main ()
{
printf ("not square =%d",SQUARE (10+2));
}

Comment hidden because of low score. Click to expand.
0

Initially it simply replaces X as
10+2 * 10+2(By precedence)
20+10+2
32

Comment hidden because of low score. Click to expand.
0
of 0 vote

#include <stdio.h>
#define SQUARE(X) X*X
#define PR(X) printf("macro is %d\n",X)
main()
{
PR(100/SQUARE(2));
}

Comment hidden because of low score. Click to expand.
0
of 0 vote

#include<stdio.h>
#define square(x) x*x
main()
{
int i;
i=64/square(4);
printf("%d",i);
}

Comment hidden because of low score. Click to expand.
0

64

Comment hidden because of low score. Click to expand.
0
of 0 vote

#include <stdio.h>
#define SQR(x)x*x
main()
{
int i;
i=64/SQR(4);
printf("%d",i);
}

Comment hidden because of low score. Click to expand.
0
of 0 vote

#define square(x) x*x void main(){ int x=6; printf("\n result is=%d",SQR(x-1));}

Comment hidden because of low score. Click to expand.
0
of 0 vote

#include<studio.h>
Int main()
{
Printf(“indiabix”);
Big main();
Return 0;
}

Name:

Writing Code? Surround your code with {{{ and }}} to preserve whitespace.

### Books

is a comprehensive book on getting a job at a top tech company, while focuses on dev interviews and does this for PMs.

### Videos

CareerCup's interview videos give you a real-life look at technical interviews. In these unscripted videos, watch how other candidates handle tough questions and how the interviewer thinks about their performance.