+ 2
Can we declare TWO variable values on a same line in C++
7 Answers
+ 3
int a = 3, b = 4, c =6; allowed :)
+ 3
@Muhammad
You can use both methods. Both are valid
int a=10; int b =20;
or
int a=10, b =20;
+ 2
int a=10; int b =20;
i think you cannot go with
int a=10, b =20;
+ 2
int a=10; int b =20;
i think you cannot go with
int a=10, b =20;
+ 2
if Datatype is Different For Two Variable Then it is possible two declare two variable on same line with different datatype
+ 1
Int a=1,b=4;c=7
0
Yes as many as you want, but separate statement for different datatype