adplus-dvertising

Welcome to the Input and Output in C MCQs Page

Dive deep into the fascinating world of Input and Output in C with our comprehensive set of Multiple-Choice Questions (MCQs). This page is dedicated to exploring the fundamental concepts and intricacies of Input and Output in C, a crucial aspect of C Programming. In this section, you will encounter a diverse range of MCQs that cover various aspects of Input and Output in C, from the basic principles to advanced topics. Each question is thoughtfully crafted to challenge your knowledge and deepen your understanding of this critical subcategory within C Programming.

frame-decoration

Check out the MCQs below to embark on an enriching journey through Input and Output in C. Test your knowledge, expand your horizons, and solidify your grasp on this vital area of C Programming.

Note: Each MCQ comes with multiple answer choices. Select the most appropriate option and test your understanding of Input and Output in C. You can click on an option to test your knowledge before viewing the solution for a MCQ. Happy learning!

Input and Output in C MCQs | Page 42 of 42

Q411.
What is the output of C program?
int main()
{
    int a=123456;
    printf("*%03d*",a);
    return 0;
}
Discuss
Answer: (c).*123456*
Q412.
What is the output of C program?
int main()
{
    int a=6543;
    printf("*%5d,*%-5d*",a,a);
    return 0;
}
Discuss
Answer: (b).* 6543,*6543 *
Q413.
What is the output of C program?
int main()
{
    float a=654.123456f;
    printf("%3.3f,%3.2f",a,a);
    return 0;
}
Discuss
Answer: (c).654.123,654.12
Q414.
What is the output of C program?
int main()
{
    char str[]="123";
    printf("*%4s*%-4s*",str,str);
    return 0;
}
Discuss
Answer: (b).* 123*123 *
Discuss
Answer: (c).sprintf(str,"formatstring",variables) prints output to string str. sscanf(str,"formatstring",&variables) scans input from str itself and assigns data to &variables.
Q416.
What is the output of C program?
int main()
{
    char ch='A';
    ch=getchar();
    putchar(ch);
    return 0;
}//input= S
Discuss
Answer: (c).S
Q417.
What is the output of c program with %* operator?
int main()
{
    char kh;
    scanf("%*c %c",&kh);
    putchar(kh);
    return 0;
}//input=G H
Discuss
Answer: (b).H

Suggested Topics

Are you eager to expand your knowledge beyond C Programming? We've curated a selection of related categories that you might find intriguing.

Click on the categories below to discover a wealth of MCQs and enrich your understanding of Computer Science. Happy exploring!