Search Placementyogi.com
 

C Console Input Output Objective Questions and Answers

  :: Topics ::

1

Prototype of printf()/scanf() functions are present in which header file?

A.

<stdio.h>

B.

<stdlib.h>

C.

<string.h>

D.

<ctype.h>

See Answer & Explanation Lets Discuss
Correct answer is : A
Explanation

No explanation available. Let's Discuss

 
2

What is the output of the following program?

Input :Hi Placement 

#include<stdio.h>
int main()
{
  char str[50];
  scanf("%s",str);
  printf("%s\t%s",str,"Yogi");
}
A.

Hi Placement Yogi

B.

Hi Placement

C.

Hi Yogi

D.

Placement Yogi

See Answer & Explanation Lets Discuss
Correct answer is : C
Explanation

The scanf() has limitation that a maximum of only one word can be accepted by it. The moment a space(or tab or a new line) is typed, scanf() assumes you have finished supplying information,and hence ignores whatever follows.

For reading more than one word string gets(str) or readline function can be used.

you can also use scanf("%s[^\n]",str);  it reads every character till new line(\n) is typed. 

 
 

Banner to LogicGuns.com

Hide Page Information

C Console Input Output Objective Questions and Answers for Written Round Interview

Here you can find C Console Input Output Objective Questions with answers and explanation. We have a vast collection of Objective Questions on Console Input Output in C that will help you a lot!

Why learn C Console Input Output?

Console Input Output are an integral part of C and many Objective Questions in the written round are asked from this topic.In this section you can learn and practice C Console Input Output (Objective Questions with Answers) to improve your skills in order to face the interview and clear campus and off-campus selection of TCS, Infosys, Wipro etc.

Where can I get C Console Input Output Objective Questions and Answers with Explanation?

PlacementYogi provides you lots of fully solved C Console Input Output Objective Questions and answers with explanation. Fully solved examples with detailed answer description, explanation are given and it would be easy to understand.Though we do not have pdf file for C Console Input Output, We have quiz Objective Questions with answers to help you test yourself..

\n

Where can I get C Console Input Output Interview Objective Questions and Answers (objective type, multiple choice)?

Here you can find objective type C Console Input Output Objective Questions and answers for interview and entrance examination.Multiple Answers and true or false type Objective Questions are also provided.

How to solve C Console Input Output problems?

You can easily solve all kind of Objective Questions based on C Console Input Output by practicing the exercises (including shortcut Console Input Output to solve problems) given below.