C Basics - C programming (MCQ) questions for Q. 27503

Q.  What will be the output of the program?

#include<stdio.h>
int main()
{
     int y=128;
     const int x=y;
     printf("%d\n", x);
     return 0;
}

- Published on 26 Feb 17

a. 128
b. Garbage value
c. Error
d. 0

ANSWER: 128
 

    Discussion

  • Avani Nawal   -Posted on 14 Sep 20
    CONST keyword is used to declare the constant in c programming , so the value of x is equal to the value of y .
  • Abhishek   -Posted on 26 Jun 17
    As x=y specifies that whatever value y is going to have the same vale will have to x

Post your comment / Share knowledge


Enter the code shown above:

(Note: If you cannot read the numbers in the above image, reload the page to generate a new one.)