MCQ Single Best Answer Not Set

QWhat will be output when you will execute following c code?

#include<stdio.h>
int main(){
    volatile int x=34;
    printf("%d",x);
    return 0;
}

ID: #907 Data Types in C Language 2,194 views
Question Info
#907Q ID
Not SetDifficulty
Data Types in C LanguageTopic

Choose the Best Option

Click any option to instantly check if you're correct.

  • A 34
  • B Garbage
  • C Compilation error
  • D We cannot predict
Correct Answer: Option D

Explanation

We cannot predict the value of volatile variable because its value can be changed by any microprocessor interrupt.

Share This Question

Challenge a friend or share with your study group.