15,668,335 members
See more:
I have tried a lot but I didn't get solved will you help me out with this
thank you...!!

C++
#include <stdio.h>
int main()
{
int a=(1, 2, 3);
int b=(3, 2, 1);

for(; a>0; a--)
for(; b<3; b++);

printf("%d ", a*b);

return 0;
}

What I have tried:

want expiation with suitable figure
Posted
Updated 24-Oct-17 8:15am
v3
CPallini 24-Oct-17 15:55pm
OUt of curiosity, where did you find such a code?

## Solution 2

The Comma operator looks like this:
C++
x = a, b;
It evaluates the expression a, discards the result, evaluates b and returns it.
So the code for a and b both get executed, and x is set to the value of b.

Your code is just an extension of that: effectively
C++
x = ((a, b) , c);
So it evaluates a and b, then evaluates c and sets x to that value.
C++
int main()
{
int a = 3;
int b = 1;

for(; a>0; a--)
for(; b<3; b++);
printf("%d ", a*b);
return 0;
}

CPallini 24-Oct-17 15:55pm
5.

## Solution 1

Look into C's comma operator. When you know how that works, you will know what a and b will be initialized to.