Select the correct answerFor single character input and output, Which functions are used?Optionsscanf() and printf()getchar() and putchar()input() and output()None of the given options are correct
Question
Select the correct answerFor single character input and output, Which functions are used?Optionsscanf() and printf()getchar() and putchar()input() and output()None of the given options are correct
Solution
The correct answer is getchar() and putchar(). These functions are used for single character input and output.
Similar Questions
Select the correct answerWhat will the output of below given code snippet?#include <stdio.h>void Function (char *S){ if (*S && *S !=' ') { Function(S+1); putchar(*S); }} int main(){ char S1[] = "CodeTantra Coding Castle"; Function(S1); return 0;}OptionsGarbage value will be printedPrints "CodeTantra Coding Castle"Prints "eltsaC gnidoC artnaTedoC"Prints "artnaTedoC"No error but nothing will be printedCompile Time Error
Multi Choice Type QuestionWhich statement correctly reads a string into a character array using scanf?Marks : 1Negative Marks : 0Answer herechar str[50]; scanf("%s", &str);char str[50]; scanf("%s", str);char str[50]; scanf("%c", &str);char str[50]; scanf("%c", str);
What will be the output of the following C program?#include<stdio.h>int main(){ char str[] = "Nagpur"; str[0]='K'; printf("%s, ", str); str = "Kanpur"; printf("%s", str+1); return 0;}Select one:Nagpur, KanpurErrorKagpur, KanpurKagpur, anpur
Find output of the below program:int main(){ char str[]={'e','a','r','t','h'}; printf("%s", str); return 0;}
Select the correct answerWhich function is used to write all the characters?Optionswriteall()writechar()writecharacters()write()
Upgrade your grade with Knowee
Get personalized homework help. Review tough concepts in more detail, or go deeper into your topic by exploring other relevant questions.