MCQ IN COMPUTER SCIENCE & ENGINEERING

COMPUTER SCIENCE AND ENGINEERING

DATA STRUCTURES

Question [CLICK ON ANY CHOICE TO KNOW THE RIGHT ANSWER]
What is the output of C Program?#include<stdio.h>void main(){ int *ptr, a=10; ptr = &a; *ptr += 1; printf("%d, %d", *ptr, a);}
A
10, 11
B
11, 11
C
11, 10
D
10, 10
Explanation: 

Detailed explanation-1: -In every C program, three basic functions take place – accepting of data as input, the processing of data, and the generation of output. The acceptance of data refers to input and the presentation of data refers to the output. The C program accepts input from the keyboard and displays output on the screen.

Detailed explanation-2: -Explanation: int a=250; The variable a is declared as an integer type and initialized to value 250. printf("%1d ", a); It prints the value of variable a. Hence the output of the program is 250.

Detailed explanation-3: -C programming language provides a set of built-in functions to read given input and feed it to the program as per requirement. Output : In any programming language output means to display some data on screen, printer or in any file. C programming language provides a set of built-in functions to output required data.

There is 1 question to complete.