0
Can we use two variables in single line by putting comma and assigning them values?
3 ответов
+ 4
Yes, this should work fine.
int a = 10, b = 20;
0
Actually I tried but it does not work.Thanks for replying.
0
Yes. But both variable should be same data type.
int a=10,b=20;
If you're using different data type separate them by semicolon " ; "
int a=10 ; float b=20.5;
Are you clear now?