May 20, 2023
program to use interchange comma operator in c language
#include<stdio.h>
int main()
{
int c=5,d=6,temp;
printf("c=%d, d=%d\n",c,d);
temp=c,c=d,d=temp;
printf("c=%d, d=%d\n",c,d);
return 0;
}
output
c=5, d=6
c=6, d=5
Steps Description
- Declare integer three variable
c , d
andtemp
- initialize in integer variable
c = 5
,d =6
printf
inbuild function display variablec
andd
with decimal placeholder %d- Assign
temp
variable with variablec
value - Assign variable
d
value withtemp
variable printf
inbuild function display variablec
and variabled
with decimal placeholder %d
by : Ajaj Khan
Quick Summary:
use interchange comma operator in c language