Home / Programs / Write a program to demonstrate the results obtained by using the increment operators along-with logical operators on operands.
Programming Example

Write a program to demonstrate the results obtained by using the increment operators along-with logical operators on operands.

👁 808 Views
💻 Practical Program
📘 Step by Step Learning
Write a program to demonstrate the results obtained by using the increment operators along-with logical operators on operands.

Program Code

/*
 Program:  Write a program to demonstrate the results obtained by using
  the increment operators along-with logical operators on operands. 
  
 Author: www.atnyla.com  
 
*/ 

#include "stdio.h"  
int main()
{
int i=0, j=1;
printf("\n %d", i++ && ++j);
printf("\n %d %d", i,j);
return 0;
} 

Output


 0
 1 1Press any key to continue . . .

Explanation

None

How to learn from this program

First read the algorithm, then study the program code line by line. After that, compare the code with the output and finally go through the explanation. This approach helps learners understand both the logic and the implementation properly.