Q:

Write a program to demonstrate print to increament and decreament operator

0

Write a program to demonstrate print to increament and decreament operator

All Answers

need an explanation for this answer? contact us directly to get an explanation for this answer

Program:

#include<stdio.h>
#include<conio.h>
void main()
{
int x=5;
x++; //post increment operator
printf("x=%d",x);
++x; //pre increment operator
printf("x=%d",x);
x--; //post decrement operator
printf("x=%d",x);
--x; //pre decrement operator
printf("x=%d",x);
getch();
}

Output:

x=6x=7x=6x=5	

need an explanation for this answer? contact us directly to get an explanation for this answer

total answers (1)

C Programming Exercises With Solutions

This question belongs to these collections

Similar questions


need a help?


find thousands of online teachers now
Write a program to calculation of sum of the digit... >>
<< Write a program to demonstrate betwise operator le...