# C Programming :: Increment-Decrement

NA
SHSTTON
50
Solv. Corr.
34
Solv. In. Corr.
84
Attempted
0 M:15 S
Avg. Time

1 / 45

What will be output of the following "c" code?
#include<stdio.h>
void main() {
int i=-1,j=-1,k=0,l=2,m;
m = i++ && j++ && k++ || l++;
printf("%d %d %d %d %d",i,j,k,l,m);
}

A0 0 1 3 1

B1 1 0 2 0

C2 2 1 3 1

DNone of these

E-1 -1 0 2 1

Answer: Option A

Explanation:

=>Logical operations always give a result of 1 or 0 .
=> Logical AND (&&) operator has higher priority over the logical OR (||) operator.

So the expression i++ && j++ && k++ is executed first. The result of this expression is 0 (-1 && -1 && 0 = 0)

Workspace

NA
SHSTTON
97
Solv. Corr.
54
Solv. In. Corr.
151
Attempted
1 M:18 S
Avg. Time

2 / 45

What will be output of the following "c" code?
#include<stdio.h>
void main(){
int i=5,j=10,num;
num=(++i,++j,i+j);
printf("%d  %d  %d",num,i,j);
}

A17 6 11

B6 6 11

C15 6 11

D15 5 10

ECompilation error

Answer: Option A

Explanation:

Int =5 is replace with 6, j=10 replace with 11,num;

Seen  below how it will

Num=(++I=1+5=6,++j=1+10=11,I+j=6+11=17);

Workspace

NA
SHSTTON
135
Solv. Corr.
61
Solv. In. Corr.
196
Attempted
0 M:10 S
Avg. Time

3 / 45

What will be output of the following "c" code?
#include<stdio.h>
void main()
{
int i=5;
printf("%d",i+++++i);
}

A5

B6

CCompiler Error

D7

Answer: Option C

Explanation:

The expression i+++++i is parsed as i ++ ++ + i which is an illegal combination of operators.

Workspace

NA
SHSTTON
15
Solv. Corr.
103
Solv. In. Corr.
118
Attempted
2 M:46 S
Avg. Time

4 / 45

What will be output of the following "c" code?
#include<stdio.h>
#include<conio.h>
void main(){
int a,i=4;
a=- -i+- -i+- -5;
printf("%d %d",a,i);
}

A13 4

B-3 2

C7 2

D-13 4

ECompilation error

Answer: Option A

Explanation:

void main()

{

int a,i=4;

int z=5;

\\*a=--i+--i+--5;*// error

a=--i+--i+--z;

printf("%d %d",a,i);}

answer

output  ia=8 i=2

Workspace

NA
SHSTTON
34
Solv. Corr.
80
Solv. In. Corr.
114
Attempted
2 M:8 S
Avg. Time

5 / 45

What will be output of the following "c" code?
#include<stdio.h>
int main()
{
int i=5,j=6,z;
printf("%d",i+++j);
return 0;
}

A12

B11

C13

DCompilation Error

ENone of these

Answer: Option B

Explanation:

the expression i+++j is treated as (i++ + j)

Workspace

NA
SHSTTON
21
Solv. Corr.
86
Solv. In. Corr.
107
Attempted
0 M:46 S
Avg. Time

6 / 45

What will be output of the following "c" code?
#include<stdio.h>
void main(){
int num,a=10;
num=a--- -a--;
printf("%d  %d",num,a);
}

A0 8

B0 10

C20 8

D-1 10

ECompilation error

Answer: Option C

Explanation:

int num,a=10;
num=a-- - -a--;  //  (10 - -9) =19   last a-- = 8 so final answer will be 19, 8
printf("%d %d",num,a);

Workspace

NA
SHSTTON
75
Solv. Corr.
6
Solv. In. Corr.
81
Attempted
0 M:0 S
Avg. Time

7 / 45

What will be output of the following "c" code?
#include<stdio.h>
#define plus +
#define minus +plus
int main(){
long x,i=3;
x=++i;
printf("%ld",x);
return 0;
}

A4

B3

C0

D6

ECompilation error

Answer: Option A

Explanation:

Here is no explanation for this answer

Workspace

NA
SHSTTON
6
Solv. Corr.
72
Solv. In. Corr.
78
Attempted
0 M:0 S
Avg. Time

8 / 45

What will be output of the following "c" code?
#include<stdio.h>
void main(){
int a[]={5,10,15};
int i=0,num;
num=a[++i]+ ++i+(++i);
printf("%d",num);
}

A6

B17

C16

D12

ECompilation error

Answer: Option A

Explanation:

its answers is 15. here num=a[1]+2+3;

where a[1]=10

so answer will be

a=10+2+3

a=15;

Workspace

NA
SHSTTON
12
Solv. Corr.
68
Solv. In. Corr.
80
Attempted
0 M:19 S
Avg. Time

9 / 45

What will be output of the following "c" code?
#include<stdio.h>
void main(){
int num,a=5;
num=---a;
printf("%d  %d",num,a);
}

A-4 4

B3 3

C-4 5

D-10

ECompilation error

Answer: Option E

Explanation:

error: invalid lvalue in decrement

Workspace

NA
SHSTTON
15
Solv. Corr.
62
Solv. In. Corr.
77
Attempted
0 M:0 S
Avg. Time

10 / 45

What will be output of the following "c" code?
#include<stdio.h>
int main()
{
int i=5;
printf("%d %d %d %d %d %d",i++,i--,++i,--i,i);
return 0;
}

A5 4 4 5 4

B4 5 5 4 5

C4 5 5 5 5

DCompilation error

Answer: Option C

Explanation:

The arguments in a function call are pushed into the stack from left to right.
The evaluation is by popping out from the stack. and the evaluation is from right to left, hence the result.

Workspace

## C Programming Increment-Decrement Questions and Answers pdf

At C Programming topic Increment-Decrement page No: 1 you will find list of 10 practice questions, tips/trick and shortcut to solve questions, solved questions, quiz, and download option to download the whole question along with solution as pdf format for offline practice. You can practice all the listed C Programming Increment-Decrement topic questions offline too, by downloading the MCQs practice question of Increment-Decrement with detail solution, with formula/Tips & Tricks, with Solved examples and with top-rated users answers, which will give you best answer ascross webs. It is one of the perfect Increment-Decrement e-book pdf covering all types of questions in detail. These C Programming test with answers pdf cover all types of question asked in IIFT, XAT, SNAP, GRE, GMAT, NMAT, CMAT, MAT or for IT companies written exam like Wipro, HCL, Infosys, Accenture, Government exams, IBPS Exams etc. There are multiple formats to download your online free C Programming Increment-Decrement e-book, like fully solved, unsolved questions with Answers sheet. Even you can customize your ebook format by adjusting the given options in the download section to make it your one of the best C Programming topic-based ebook. It is recommended to bookmark this page C Programming Increment-Decrement for your preparation. Most of the students and fresher candidates finding it hard to clear the C Programming section in exams. Here Given Increment-Decrement practice questions, quiz, fully solved questions, tips & trick and Mock tests, which include question from each topic will help you to excel in Increment-Decrement. Each test has all the basics questions to advanced questions with answer and explanation for your clear understanding, you can download the test result as pdf for further reference.

At C Programming topic Increment-Decrement, you will get multiple online quiz difficulty wise, which will have a total of 6 quizzes, categorized as easy, medium, and moderate level. While preparing for any Increment-Decrement, take all the list quiz and check your preparation level for that topic. Each quiz have 10 different question, which needs to be answered in 20 min., all the listed quiz here is free, however, you will get only one chance for each quiz to attempt(Take Quiz seriously), so it is always recommended to take one quiz in each section before you start solving Increment-Decrement MCQs practice question, and one after solving all the question of the respective level, you can refer back your Increment-Decrement quiz result any time or you can download it as pdf for reference.

## C Programming Quiz Online Test

The details of the C Programming quiz are as follows. There are 10 questions for you. You have to answer them in 20 minutes. Within 20 minutes you have to see the errors in the sentences given as a question. Four options are also given to you, and you have to choose your opinion. You must be confident in your answer that the choices are difficult. Therefore, below we provide you with some information about C Programming that you see and keep them in mind while answering questions.

## C Programming MCQs Practice Questions with Answer

On this section of page you will find the easiest quickest ways to solve a question, formulas, shortcuts and tips and tricks to solve various easiest methods to solve C Programming Question Quickly. It contains all the C Programming topic Increment-Decrement questions which are common in any of the preliminary exams of any company. The solution is provided along with the questions. The practice of these questions is a must as they are easy as well as scoring and asked in all the exams They will confirm the selection if all the questions attempted wisely with little practice. It is recommanded to Take Mock test based on C Programming topic and Increment-Decrement topic based quiz.

## C Programming solved examples question

Clarity of concepts is a must if you want to master the skill of solving C Programming problems. This page contains sample C Programming questions and answers for freshers and competitive exams. C Programming Questions with the detailed description, the explanation will help you to master the topic. Here solved examples with detailed answer description, explanations are given and it would be easy to understand. How to solve questions relating to C Programming? Here are some examples solved with the Common Rules/tricks/tips of C Programming. Enhance your chance to score maximum marks in C Programming sections through. Error Spotting Grammar Questions Online Test for Free. Fully solved Sentence Formation MCQs questions with detailed answer description. C Programming is an important topic for any exams but most aspirants find it difficult. You need to learn various tricks tips, rules, etc to solve quickly. At this page, you will find frequently asked C Programming questions or problems with solutions, shortcuts, formulas for all-important competitive exams like IT companies exams, interviews. It is always a best practice to go through the example and understand the types of question and way to solve it, so let's do some examples to calculate efficiency, read through all the given here solved examples. You can post your solution, tips, trick and shortcut if you have any in respect to questions.

You can get here fully solved Increment-Decrement examples with a detailed answer and description. You can solve Increment-Decrement problems with solutions, the questions by companies wise by filtering the questions, additionally, you can check what type of questions are being asked in IT companies Written Round from Increment-Decrement. Increment-Decrement became one of the most important sections in the entire competitive exams, Companies Campus, and entrance online test. Go through Increment-Decrement Examples, Increment-Decrement sample questions. You can Evaluate your level of preparation in Increment-Decrement by Taking the Q4Interivew Increment-Decrement Online Mock Test based on most important questions. All the Increment-Decrement practice questions given here along with answers and explanations are absolutely free, you can take any number of time any mock Test.

## Why C Programming Increment-Decrement?

In this practice section, you can practice C Programming Questions based on "Increment-Decrement" and improve your skills in order to face the interview, competitive examination, IT companies Written exam, and various other entrance tests (CAT, GATE, GRE, MAT, Bank Exam, Railway Exam etc.) with full confidence.

## Where can I get C Programming Increment-Decrement questions and answers with explanation?

Q4Interview provides you lots of fully solved C Programming (Increment-Decrement) questions and answers with Explanation. Solved examples with detailed answer description, explanation are given and it would be easy to understand. You can download C Programming Increment-Decrement quiz questions with answers as PDF files and eBooks.

## Where can I get C Programming Increment-Decrement Interview Questions and Answers (objective type, multiple-choice, quiz, solved examples)?

Here you can find objective type C Programming Increment-Decrement questions and answers for interview and entrance examination. Multiple choice and true or false type questions are also provided.