If the variable name is 'age' and the programmer wants to input age, which is the correct syntax?
- cin(age)
- cin<<age;
- cin>>age;
- None of these
Explanation
cin >> age; is the correct syntax in C++ to take input from the user and store it in the variable age.
The >> operator is used with cin to extract the input value into the variable.
Related MCQs
وی ڈی یو کا مطلب کیا ہے؟
- Very Display Unit
- Virtual Display Uniform
- Visual Display Unit
- Virtual Detection Unit
اس سوال کو وضاحت کے ساتھ پڑھیں
لسپ پروگرامنگ زبان کس نے ایجاد کی؟
- James Gosling
- Dennis Ritchie
- John McCarthy
- None of these
اس سوال کو وضاحت کے ساتھ پڑھیں
لفظ ویبلاگ کس نے متعارف کروایا جس سے بلاگ کا لفظ نکلا؟
- Justin Hall
- Jorn Barger
- Bill Gates
- None of these
اس سوال کو وضاحت کے ساتھ پڑھیں
انٹرنیٹ پر فائلوں کی منتقلی کے لئے کون سا پروٹوکول استعمال کیا جاتا ہے؟
- FTP
- DNS
- IP
- None of these
اس سوال کو وضاحت کے ساتھ پڑھیں
ایچ ٹی ٹی پی کے لیے ڈیفالٹ پورٹ کون سا ہے؟
- 20
- 21
- 80
- 443