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
سی پی یو کے اندر کون سی میموری نصب ہوتی ہے؟
- RAM
- ROM
- Register
- None of these
اس سوال کو وضاحت کے ساتھ پڑھیں
ورلڈ وائیڈ ویب کو رابرٹ کیلِیو کے ساتھ کس نے ایجاد کیا؟
- Tom Burne
- Tim Burner Lee
- Fred Zuckerberg
- Both a and b
اس سوال کو وضاحت کے ساتھ پڑھیں
مصنوعی ذہانت کا بانی کسے کہا جاتا ہے؟
- Mark Zuckerberg
- Alan Turing
- John McCarthy
- Bill Gates
اس سوال کو وضاحت کے ساتھ پڑھیں
کمپیوٹر گرافکس کا بانی کسے کہا جاتا ہے؟
- Charles Babbage
- Alan Turing
- Ivan Sutherland
- None of these
اس سوال کو وضاحت کے ساتھ پڑھیں
دوسری نسل کے کمپیوٹر میں مندرجہ ذیل میں سے کون سی ٹیکنالوجیز استعمال ہوئی؟
- Vacum Tubes
- Transistors
- Integrated circuits
- None of these