Computer Science, asked by pranjalibonde8, 23 days ago

2. #include<stdio.h> int X=40; 1 point
void main() { int X=20;
printf("%d\n", X); } *
O a) 20
O b) 40
O c) No Output
O d) Error​

Answers

Answered by Anonymous
53

Required Answer :

Given program:

#include<stdio.h> int X=40; 1 point

void main() { int X=20;

printf("%d\n", X); }

To find:

  • The output of the given program.

Solution:

First let's correct the required program.

#include<stdio.h>

int X=40;

void main()

{

int X=20;

printf("%d\n", X);

}

Output:

The output of the given program will be as follows:

20

Option (a) 20 is correct.

[NOTE: The given cοde is from C program.]

Extra information :

  • C is a computer programming language.
  • C was developed by Ken Thompson and Dennis.
  • C was developed in early 1970s at Bell labs.
  • C was developed to do computer programming.
Answered by misscutie94
4

Answer:

Question :-

2. #include<stdio.h> int X=40; 1 point

void main() { int X=20;

printf("%d\n", X); }

a) 20.

❍ b) 40.

❍ c) No Output.

❍ d) Error.

Solution :-

We can understand by seeing the program that it is C programming language.

Now, we have to correct some parts :

Input :-

#include<stdio.h>

int X = 40;

void main()

{

int X = 20;

printf ("%d\n",X);

}

Output :-

The output of the above program is 20.

Henceforth, the correct options is a) 20.

Similar questions