+ 2

Can we declare TWO variable values on a same line in C++

13th Mar 2017, 10:38 AM
CRYPTONaXE
CRYPTONaXE - avatar
7 Answers
+ 3
int a = 3, b = 4, c =6; allowed :)
13th Mar 2017, 12:00 PM
kibbekPL
kibbekPL - avatar
+ 3
@Muhammad You can use both methods. Both are valid int a=10; int b =20; or int a=10, b =20;
14th Mar 2017, 4:59 PM
ā¤ĻāĨ‡ā¤ĩāĨ‡ā¤‚ā¤ĻāĨā¤° ā¤Žā¤šā¤žā¤œā¤¨ (Devender)
ā¤ĻāĨ‡ā¤ĩāĨ‡ā¤‚ā¤ĻāĨā¤° ā¤Žā¤šā¤žā¤œā¤¨ (Devender) - avatar
+ 2
int a=10; int b =20; i think you cannot go with int a=10, b =20;
13th Mar 2017, 10:51 AM
Muhammad Umair
Muhammad Umair - avatar
+ 2
int a=10; int b =20; i think you cannot go with int a=10, b =20;
13th Mar 2017, 10:51 AM
Muhammad Umair
Muhammad Umair - avatar
+ 2
if Datatype is Different For Two Variable Then it is possible two declare two variable on same line with different datatype
30th Sep 2017, 3:57 AM
Muhammad UZAIR
Muhammad UZAIR - avatar
+ 1
Int a=1,b=4;c=7
14th Mar 2017, 4:04 PM
Bh G
Bh G - avatar
0
Yes as many as you want, but separate statement for different datatype
13th Mar 2017, 12:36 PM
ā¤ĻāĨ‡ā¤ĩāĨ‡ā¤‚ā¤ĻāĨā¤° ā¤Žā¤šā¤žā¤œā¤¨ (Devender)
ā¤ĻāĨ‡ā¤ĩāĨ‡ā¤‚ā¤ĻāĨā¤° ā¤Žā¤šā¤žā¤œā¤¨ (Devender) - avatar