Skip to content

Tag Archives: Input and Output

Every program takes some data as input and generates processed data as an output following the familiar input process output cycle. It is essential to… Read More
The cin object in C++ is used to accept the input from the standard input device i.e., keyboard. it is the instance of the class… Read More
The cout object in C++ is an object of class ostream. It is defined in iostream header file. It is used to display the output… Read More
The cin object in C++ is an object of class istream. It is used to accept the input from the standard input device i.e. keyboard.… Read More
There are two methods in which input can be taken in a more secure way: Do not display any content. Display a special character such… Read More
The Scanner class in java.util package used for obtaining the input of the primitive types like int, double, etc. and strings. It is the easiest… Read More
Java IO(Input/Output) is used to perform read and write operations. The java.io package contains all the classes required for input and output operation. Whereas, Java… Read More
Formatting in C: In C language format specifiers are used to input and output. It is a way to tell the compiler what type of… 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? #include<stdio.h> int main() {     printf("%d", printf("%d", 1234));     return 0; } (A) 12344 (B) 12341 (C) 11234 (D) 41234 Answer: (A) Explanation:… Read More
Predict the output of following program? #include <stdio.h> int main(void)  {    int x = printf("GeeksQuiz");    printf("%d", x);    return 0; } (A) GeeksQuiz9 (B) GeeksQuiz10 (C)… Read More
#include<stdio.h>    int main() {     char *s = "Geeks Quiz";     int n = 7;     printf("%.*s", n, s);     return 0; } (A) Geeks Quiz (B) Nothing… Read More
What does the following C statement mean? scanf("%4s", str); (A) Read exactly 4 characters from console. (B) Read maximum 4 characters from console. (C) Read… 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
Which of the following is true (A) gets() can read a string with newline chacters but a normal scanf() with %s can not. (B) gets()… Read More