ExamCompetition Forum Question Papers Ask A Question Mock Test Learn & Earn Sign Up Login Menu



0 vote

What will be output if you will compile and execute the following c code?#include<stdio.h>#define max 5void main(){ int i = 0; i = max++; printf("%d", i++);}

Asked on by | Votes 0 | Views: 63 | Tags: computer science     | c programming     | c preprocessor     | Add Bounty

What will be output if you will compile and execute the following c code?#include<stdio.h>#define max 5void main(){ int i = 0; i = max++; printf("%d", i++);}

A).  5

B).  6

C).  7

D).  0

E).  Compiler Error


Share on Facebook      Share on Whatsapp       Share on Twitter




1 answers

0 vote
Answered by on | Votes 0 |

 Compiler Error



main.c: In function ‘main’:
main.c:5:12: error: lvalue required as increment operand
i = max++;

Join Telegram Group




Answer This Question

Name:
Email:
Answer :
Sum of (5+2)
Submit: