Note 1

Take Note:

Take a note while surfing.





Note With Ink

Give your Note a Colorful Tag.




Easy to Access

Stay on same information and in Sync wherever you are.

Note 2

Take Note:

Organize your information,It may take Shape.





Think With Ink

Differ your Content by Color.




Easy to Access

Easy to pull up your content from anywhere anytime.

Note 3

Take Note:

Don't Let information to miss,Because it take shape





Note With Ink

Simple an Easy Way to take a note.




Easy to Access

Get the same in next visit.


Please wait...

C Programming :: Declarations and Initializations

31. What will be output of the following "c" code?

#include
void main ( )
{
int i, m=2, n=3;
for( i=0;m+n=5; m++)
printf("%d %d", m,n);
}

Answer: Option A

Explanation:

error: lvalue required as left operand of assignment

Workspace


Tags:  No Tags on this question yet!

32. What will be output of the following "c" code?

#include
void main ()
{
int x =400, y;
y = x*x+x;
printf ("% d", y);
}

Answer: Option D

Explanation:

In line 5-

y=x*x+x

or, y=400*400+400

or, y=160000+400

or, y=160400

Therefore, option D.

Workspace


Tags:  No Tags on this question yet!

33. What is the output of the following program?

void main()
{
int x,y, z;
x=2; y=1; z = 1;
if(x > y + z)
printf("Hello!\n");
else if (x < y+ z)
printf ("Hi!\n");
else
printf("Hey!\n");
}

Answer: Option B

Explanation:

answer is option B

x>y+Z 

2>1+1 = 2>2 false 

x<y+z 2<2 false

condition goes to else and prints Hey!

Workspace


Tags:  No Tags on this question yet!

34. What would be the output of the following C program ?

void main() {
int = 12345;
float x = 145.678;
printf ("%3d, %5d, %8d", i,i,i,);
}

Answer: Option C

Explanation:

i not declared and in printf (,) is the extra is shows error

assume if int i=12345;

and all syntax is right then the answer will be 

12345,   12345,      12345

(check in GDB if you have any doubts)

Workspace


Tags:  No Tags on this question yet!

Answer: Option B

Explanation:

Here is no explanation for this answer

Workspace


Tags:  No Tags on this question yet!

Answer: Option C

Explanation:

Data Type                                                                Value Range

    int                                                             -2,147,483,648 to 2,147,483,648

  short                                                           -32,768 to 32,767

Clearly, the range of normal int is far greater than short, hence short int  is used for variables which may require less storage than normal integers.

Workspace


Tags:  No Tags on this question yet!

Answer: Option A

Explanation:

An ‘int’ is actually 1 sign bit + 31 data bits, i.e, 31 bits are available for storing the number being assigned to a ‘int’ type variable and 1 bit(leftmost bit) is reserved for maintaining the sign of the number which is either '+' or '–' . The sign is also represented by binary digits, '0' for positive sign and '1' for negative sign.

Workspace


Tags:  No Tags on this question yet!

38. Find the output for the following C program

#include
int main()
{
int x=2,y=6,z=6;
x=y==z;
printf("%d",x);
}

Answer: Option D

Explanation:

In line no. 5-

x=y==z;    Result is 1 as y==z is True, as 6==6.

                 Then, 1 will be assigned to x

Hence, option D is correct.

Workspace


Tags:  Cisco

39. Find the output for the following C program

void main
{
int x,j,k;
j=k=6;x=2;
x=j*k;
printf("%d", x);
}

Answer: Option B

Explanation:

Here, j=6, k=6

So, x=j*k

or, x=6*6;

x=36

Hence, 36 is the output.

Workspace


Tags:  Cisco

40. In signed magnitude notation what is the minimum value that can be represented with 8 bits

Answer: Option A

Explanation:

The range of an 8-bit sign-magnitude integer is -128 to +127.

Hence, the minimum value that can be represented from the given range is -128.

Workspace


Tags:  Cisco



Most Popular Qs.

Latest MCQ Qs.