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
کون سا آپریٹنگ سسٹم ملتے جلتے کاموں کو گروپ بنا کر بیچز کی صورت میں چلاتا ہے؟
- Real-time operating system
- Batch operating system
- Distributed operating system
- None of these
اس سوال کو وضاحت کے ساتھ پڑھیں
کمپیوٹر کے مدر بورڈ پر سی ایم او ایس بیٹری کا کیا کام ہے؟
- To power the processor
- To maintain system time and BIOS/UEFI settings
- To increase internet speed
- None of these
اس سوال کو وضاحت کے ساتھ پڑھیں
درج ذیل میں سے کون سی آپٹیکل اسٹوریج ڈیوائس کی مثال ہے؟
- SSD
- DVD Drive
- Hard drive
- None of these
اس سوال کو وضاحت کے ساتھ پڑھیں
جی این یو آپریٹنگ سسٹم کا منصوبہ کس نے شروع کیا؟
- Bill Gates
- Steve Jobs
- Richard Stallman
- None of these
اس سوال کو وضاحت کے ساتھ پڑھیں
مندرجہ ذیل میں سے کون سی غیر مستحکم میموری ہے؟
- RAM
- ROM
- Cache
- Both A and C