ایک مقدار جس کی قیمت پروگرام پر عمل درآمد کے دوران بدل سکتی ہے اسے _____ کہا جاتا ہے؟
A. Constant
B. None of these
C. Variable
D. Header
Explanation
A variable is a named memory location whose value can change during the execution of a program.
In contrast, a constant has a fixed value that does not change while the program runs.
Show/Hide Explanation
A. cin>>age;
B. cin<<age;
C. cin(age)
D. 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.
Show/Hide Explanation
A. z will be converted to long and z will be calculated as long
B. y will be converted to int and z will be calculated as int
C. z will be converted to long and z will be calculated as int
D. Compiler will generate error
Explanation
In z = z + y;, since z is an int and y is long , y is converted to int (if possible) to match the type of z due to usual type conversion rules.
The result is calculated as an int, and this may cause data loss if y exceeds int range.
Show/Hide Explanation
مندرجہ ذیل میں سے کون سا متغیر کے لئے صحیح ہے جو مطلوبہ الفاظ کے ساتھ بیان کیا گیا ہے اور سی زبان میں کسی قدر سے شروع کیا گیا ہے؟
A. Does not differ from the variable that is declared without const and initialized
B. Cannot be changed within the scope of the variable during execution of the program
C. Can be overwritten within the scope of the variable
D. Can be changed within the scope of the variable
Explanation
A variable declared with the const keyword in C becomes read-only and its value cannot be modified after initialization.
Attempting to change a const variable will result in a compile-time error.
Show/Hide Explanation
مندرجہ ذیل میں سے کون سی زبان میں متغیر کا نام بننے کے اہل نہیں ہے؟
A. "age"
B. "address"
C. "define"
D. "name"
Explanation
" define " is a reserved keyword in C, used in preprocessor directives (e.g., #define ) and cannot be used as a variable name.
Variable names like " address ", " name ", and " age " are valid as they follow C naming rules and aren't reserved.
Show/Hide Explanation
A. may not
B. may
C. must not
D. must
Explanation
For using a variable in C ++, we have to first define it to tell the compiler about its existence so that compiler can allocate the required memory to it .
AGM 24-12-2022
Show/Hide Explanation
A. Register
B. codes
C. calling function
D. Memory space
Explanation
Lifetime of a variable is the time for which the variable is taking up a valid space in the system's memory .
Show/Hide Explanation
متغیر کے دائرہ کار سے کیا مراد ہے۔
A. length of variable
B. name of variable
C. none
D. accessibility of variable
Explanation
Variable scope refers to the extent of code in which a variable can be referenced.
Variables defined inside a function are called local variables.
The scope of local variables and dummy arguments is limited to the function in which they are defined.
Show/Hide Explanation
A. None of these
B. Character variable
C. String variable
D. Integer variable
Explanation
The format specifier %c is used in scanf to read a single character.
So, km must be a character variable , e.g., char km; .
Show/Hide Explanation
پروگرام کے عمل کے دوران کی بورڈ سے متغیرات میں ویلیو حاصل کرنے کے لیے کون سا فنکشن استعمال ہوتا ہے؟
A. Printf()
B. Scanf()
C. Main()
D. Getch()
Explanation
The function used to get values into variables from the keyboard is scanf() .
It reads input from the standard input ( usually the keyboard ) and stores it in the specified variables.
Show/Hide Explanation
✅ Correct: 0 |
❌ Wrong: 0 |
📊 Total Attempted: 0