Que: Write a c program to explain increment and decrement operators.
Ans:
#include<stdio.h>
int main()
{
int x = 12, y = 1;
printf("Initial value of x = %d\n", x);
printf("Initial value of y = %d\n\n", y);
y = ++x;
printf("After incrementing by 1: x = %d\n", x);
printf("y = %d\n\n", y);
y = --x;
printf("After decrementing by 1: x = %d\n", x);
printf("y = %d\n\n", y);
return 0;
}
..................................................................................................................................................................
Now its turn to show input and output of this operations:
..................................................................................................................................................................
.....................................................................................................................................................................
***********************************************************************************
For any problem related to this : please e.mail me : sahilsengra4545@gmail.com
***********************************************************************************
Comments
Post a Comment