+ Addition % Modulus
- Subtraction ++ Increment
* Multiplication -- Decrement
/ Division
Increment and Decrement Operators can be post-fixed or pre-fixed. When it is pre-fixed the value is computed before the expression is evaluated, however when it is post-fixed the value is computed after the expression is evaluated.
#include <stdio.h>
int main()
{
int a,x;
printf("Enter some integer: ");
scanf("%d",&a);
x=a++;
printf("\nx : %d",x);
printf("a : %d",a);
x=a++;
printf("\nx : %d",x);
printf("a : %d",a);
x=++a;
printf("\nx : %d",x);
printf("a : %d",a);
x=++a;
printf("\nx : %d",x);
printf("a : %d",a);
return;
}
Output of this program is:
Enter some integer: 10
x : 10 a : 11
x : 11 a : 12
x : 13 a : 13
x : 14 a : 14
Urgenthomework helped me with finance homework problems and taught math portion of my course as well. Initially, I used a tutor that taught me math course I felt that as if I was not getting the help I needed. With the help of Urgenthomework, I got precisely where I was weak:
Read More
Follow Us