An Interest In:
Web News this Week
- April 27, 2024
- April 26, 2024
- April 25, 2024
- April 24, 2024
- April 23, 2024
- April 22, 2024
- April 21, 2024
March 31, 2022 08:58 am GMT
Original Link: https://dev.to/selmonhaftom/pre-increment-operator-c-program-bk4
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:
Tweet
View Full Article
Dev To
An online community for sharing and discovering great ideas, having debates, and making friendsMore About this Source Visit Dev To