Variable | MCQs

    Q1: A quantity whose value may change during execution of the program is called a _____?

    ایک مقدار جس کی قیمت پروگرام پر عمل درآمد کے دوران بدل سکتی ہے اسے _____ کہا جاتا ہے؟
    • A. Header
    • B. Constant
    • C. None of these
    • D. Variable
    • A. cin>>age;
    • B. cin<<age;
    • C. None of these
    • D. cin(age)
    • A. z will be converted to long and z will be calculated as int
    • B. y will be converted to int and z will be calculated as int
    • C. Compiler will generate error
    • D. z will be converted to long and z will be calculated as long

    Q4: Which of the following is TRUE for a variable defined with the keyword const and initialized to a value in C language?

    مندرجہ ذیل میں سے کون سا متغیر کے لئے صحیح ہے جو مطلوبہ الفاظ کے ساتھ بیان کیا گیا ہے اور سی زبان میں کسی قدر سے شروع کیا گیا ہے؟
    • A. Can be changed within the scope of the variable
    • B. Does not differ from the variable that is declared without const and initialized
    • C. Can be overwritten within the scope of the variable
    • D. Cannot be changed within the scope of the variable during execution of the program

    Q5: Which of the following does NOT qualify to be the name of a variable in C language?

    مندرجہ ذیل میں سے کون سی زبان میں متغیر کا نام بننے کے اہل نہیں ہے؟
    • A. "age"
    • B. "define"
    • C. "address"
    • D. "name"
    • A. may
    • B. must
    • C. may not
    • D. must not
    • A. codes
    • B. Memory space
    • C. calling function
    • D. Register

    Q8: Scope of variable refers to

    متغیر کے دائرہ کار سے کیا مراد ہے۔
    • A. accessibility of variable
    • B. name of variable
    • C. none
    • D. length of variable
    • A. String variable
    • B. Character variable
    • C. Integer variable
    • D. None of these

    Q10: Which function is used to get values into variables from the keyboard during the execution of a program?

    پروگرام کے عمل کے دوران کی بورڈ سے متغیرات میں ویلیو حاصل کرنے کے لیے کون سا فنکشن استعمال ہوتا ہے؟
    • A. Main()
    • B. Scanf()
    • C. Getch()
    • D. Printf()
✅ Correct: 0 | ❌ Wrong: 0 | 📊 Total Attempted: 0