Tag Archives: C-Input and Output Quiz

How to input a large number (a number that cannot be stored even in long long int) without spaces? We need this large number in… Read More
fflush() is typically used for output stream only. Its purpose is to clear (or flush) the output buffer and move the buffered data to console… Read More
scanf() : The C library function int scanf (const char *format, …) reads formatted input from stdin. Syntax: int scanf(const char *format, ...) Return type:… Read More
Predict the output of the following C program with a printf inside printf. filter_none edit close play_arrow link brightness_4 code #include<stdio.h>     int main() {… Read More
Below are some interesting facts about C programming: 1) The case labels of a switch statement can occur inside if-else statements. filter_none edit close play_arrow… Read More
Many of us know the traditional uses of scanf. Well, here are some of the lesser known facts How to read only a part of… Read More
Consider below simple program in C. The program reads an integer using scanf(), then reads a string using fgets(). filter_none edit close play_arrow link brightness_4… Read More
All of these functions read a character from input and return an integer value. The integer is returned to accommodate a special value used to… Read More
printf: printf function is used to print character stream of data on stdout console. Syntax : int printf(const char* str, ...); Example : filter_none edit… Read More
What is the return type of getchar()? (A) int (B) char (C) unsigned char (D) float Answer: (A) Explanation: The return type of getchar() is… Read More
Output of following program? filter_none edit close play_arrow link brightness_4 code #include<stdio.h> int main() {     printf("%d", printf("%d", 1234));     return 0; } chevron_right filter_none (A) 12344… Read More
Predict the output of following program? filter_none edit close play_arrow link brightness_4 code #include <stdio.h> int main(void)  {    int x = printf("GeeksQuiz");    printf("%d", x);    return… Read More
filter_none edit close play_arrow link brightness_4 code #include<stdio.h>    int main() {     char *s = "Geeks Quiz";     int n = 7;     printf("%.*s", n, s);     return… Read More
What does the following C statement mean? filter_none edit close play_arrow link brightness_4 code scanf("%4s", str); chevron_right filter_none (A) Read exactly 4 characters from console.… Read More
Which of the following is true (A) gets() doesn’t do any array bound testing and should not be used. (B) fgets() should be used in… Read More