May 20, 2023
program to use comma operators in c language
#include<stdio.h>
int main()
{
int e,f,g,sum;
sum = (e=6,f=4,g=12,a+b+c);
printf("sum=%d\n",sum);
return 0;
}
output
sum=24
Steps Description
- Declare integer four variables
e , f
andg
andsum
- initialize in integer variables
e
,f
andg
- Assign
sum
variable with sum of variablese
andf
andg
printf
inbuild function displaysum
variable with decimal placeholder %d
by : Ajaj Khan
Quick Summary:
use comma operators in c language