C Programming :: Operators Expressions

NA
SHSTTON
7
Solv. Corr.
6
Solv. In. Corr.
13
Attempted
0 M:0 S
Avg. Time

1 / 7

What is the output of the following 'C' program ?
#include <stdio.h>
int main()
{
int x=20,y=35; 
x=y++ + x++;
y=++y + ++x;
printf("%d  %d",x,y);
return 0;
}

A22,40

B57,35

C22,37

D57,94

 View Answer |  Discuss in Forum |  Workspace | Asked In BOA (Bank of America) |

Answer: Option D

Explanation:

Here is no explanation for this answer

Workspace

NA
SHSTTON
3
Solv. Corr.
6
Solv. In. Corr.
9
Attempted
0 M:0 S
Avg. Time

2 / 7

What will be value of count after the following C program is executed?
#include<stdio.h>
void main()
{
int count, digit = O;
count= 1;
while (digit <= 9){
printf ("%d/n", ++count);
++ digit;
}

A10

B8

C12

D11

Answer: Option D

Explanation:

Here is no explanation for this answer

Workspace

NA
SHSTTON
5
Solv. Corr.
3
Solv. In. Corr.
8
Attempted
0 M:0 S
Avg. Time

3 / 7

How many times will the printf statement be executed?
#include<stdio.h>
void main()
{ 
int n; n=10;
while(n < 10){
printf ("hello");
--n;
}  }

ANever

BOnce

C10

D9

Answer: Option A

Explanation:

Here is no explanation for this answer

Workspace

NA
SHSTTON
2
Solv. Corr.
6
Solv. In. Corr.
8
Attempted
0 M:0 S
Avg. Time

4 / 7

What is the final value of digit?
#include<stdio.h>
void main()
{
int digit
for (digit = 0; digit < = 9; ++digit)
printf ("%d/n", digit);
digit = 2*digit;
- - digit;
}

A19

B-1

C17

D16

Answer: Option A

Explanation:

Here is no explanation for this answer

Workspace

NA
SHSTTON
6
Solv. Corr.
12
Solv. In. Corr.
18
Attempted
0 M:0 S
Avg. Time

5 / 7

What is the output of the following 'C' program ?
#include<stdio.h>
int main()
{
  int k=5;
  for(++k<5 && k++/5 || ++k<8);
  printf("%d\n",k);
 }

A5

B6

C7

D8

 View Answer |  Discuss in Forum |  Workspace | Asked In Global Edge |

Answer: Option C

Explanation:

Here is no explanation for this answer

Workspace

NA
SHSTTON
2
Solv. Corr.
2
Solv. In. Corr.
4
Attempted
0 M:0 S
Avg. Time

6 / 7

Predict the output of following "C" code:
#include<stdio.h>
main()
{
int x,a=10;
x=9*5+ 7/3 -6+a;
printf("%d",x);
}

A51

B51.5

C31

DNone of these

Answer: Option A

Explanation:

45+2-6+10 = 51
7/3 =2 int division

Workspace

NA
SHSTTON
3
Solv. Corr.
4
Solv. In. Corr.
7
Attempted
0 M:0 S
Avg. Time

7 / 7

Choose the correct option.

Which among the following operator has the right to left associativity?


AArithmetic

Blogical

CRelational

DIncrement/Decrement

Answer: Option D

Explanation:

Here is no explanation for this answer

Workspace