[ Latest ] Viasat Technical Interview Questions and Answers.
Practice List of Paytm Coding Questions !!!
Take 30+ FREE!! Online Arithmetic Aptitude Mock test to crack any Exams.

# Increment-Decrement Questions

NA
SHSTTON
164
Solv. Corr.
135
Solv. In. Corr.
299
Attempted
0 M:16 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

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
252
Solv. Corr.
154
Solv. In. Corr.
406
Attempted
1 M:36 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

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
452
Solv. Corr.
184
Solv. In. Corr.
636
Attempted
0 M:19 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

Explanation:

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

Workspace

NA
SHSTTON
99
Solv. Corr.
371
Solv. In. Corr.
470
Attempted
1 M:24 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

Explanation:

void main()

{

int a,i=4;

int z=5;

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

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

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

output  ia=8 i=2

Workspace

NA
SHSTTON
101
Solv. Corr.
225
Solv. In. Corr.
326
Attempted
0 M:53 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

Explanation:

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

Workspace

NA
SHSTTON
59
Solv. Corr.
224
Solv. In. Corr.
283
Attempted
0 M:47 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

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
273
Solv. Corr.
43
Solv. In. Corr.
316
Attempted
0 M:4 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

Explanation:

Here is no explanation for this answer

Workspace

NA
SHSTTON
29
Solv. Corr.
210
Solv. In. Corr.
239
Attempted
0 M:30 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

Explanation:

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

where a[1]=10

a=10+2+3

a=15;

Workspace

NA
SHSTTON
69
Solv. Corr.
233
Solv. In. Corr.
302
Attempted
0 M:22 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

Explanation:

error: invalid lvalue in decrement

Workspace

NA
SHSTTON
37
Solv. Corr.
185
Solv. In. Corr.
222
Attempted
0 M:4 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

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, 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 Increment-Decrement Customize Online Mock Test

This is own type of mock test, where At this C Programming Increment-Decrement MCQs mock test section, you will able to attempt only the questions related to Increment-Decrement, in that question will be a different level, important, and all the questions will be part of some of the mock tests across Q4interview FREE Mock test. You need to choose the topic as Increment-Decrement, and click on Double click to generate your customize mock test. While attempting the mock test you need to choose any of the one options out of given option. It is recommended to go through the direction given along with each question, as these questions will be randomly and so that same direction will not be applicable across the entire test. Once you submit your mock test, the result will be generated for Increment-Decrement Customize mock test, where your performance point points will be highlighted. Q4interview analysis every single point which helps you to improve your topic understanding and help you to know your type of mistakes and way to improve Increment-Decrement questions, by providing the same type of practice questions from practice exercise. The best part of this Increment-Decrement, all these mock tests listed here are free and you can take as Many time, as many you want. When you continue to give Increment-Decrement Customize Online Mock Test here regularly, then you will understand how much you have developed your accuracy on a topic, after that you will be able to decide how much attention you need to focus on. Your continued practice will increase your confidence, speed and thinking ability intensely, the Increment-Decrement Customize topic on which you will practice more will beneficial for you in future during campus placement.

## C Programming Increment-Decrement Quiz Online Test

The details of the C Programming Increment-Decrement 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 Increment-Decrement that you see and keep them in mind while answering questions.

## C Programming Increment-Decrement MCQs Practice Questions with Answer

On this Increment-Decrement 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 Increment-Decrement 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 Increment-Decrement solved examples question

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.