Your Web News in One Place

Help Webnuz

Referal links:

Sign up for GreenGeeks web hosting
March 31, 2022 08:58 am GMT

Pre-increment Operator: C Program

In pre-increment, first the value of the variable is incremented after that the assignment or other operations are carried

#include <stdio.h>int main(){int a = 11 ,b;b = ++a;      printf("b = %d

", b); printf("a = %d
", a); return 0; }

Output
b = 12
a = 12

Here first the value of a increments and then is assigned to variable b. So both a and b value will be 11.


Original Link: https://dev.to/selmonhaftom/pre-increment-operator-c-program-bk4

Share this article:    Share on Facebook
View Full Article

Dev To

An online community for sharing and discovering great ideas, having debates, and making friends

More About this Source Visit Dev To