Programming Languages C Objective
Mar 09, 2013

What will be output of the following c code?

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

Choose the correct answer:
A) -2
B) Garbage
C) We cannot predict
D) Compilation error
Detailed Explanation

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

Discussion (0)

No comments yet. Be the first to share your thoughts!

Share Your Thoughts
Feedback