Hello, OnlineGDB Q&A section lets you put your programming query to fellow community users. Asking a solution for whole assignment is strictly not allowed. You may ask for help where you are stuck. Try to add as much information as possible so that fellow users can know about your problem statement easily.

how to input charaters?

0 votes
asked Jun 5, 2019 by anonymous

5 Answers

0 votes
answered Jun 5, 2019 by Kalpana Gokul
Use getchar()
0 votes
answered Jun 6, 2019 by anonymous
use the function input()
+1 vote
answered Jun 6, 2019 by kingkrab (160 points)

In order to input any character, first you need to initialize it with "char" data type. Then using "scanf(%c)" the character can be taken as input.

There is one more way to take input i.e using "getchar()".

0 votes
answered Jun 17, 2019 by sai swetha.G
by using getchar()
0 votes
answered Jun 22, 2019 by nandhini (160 points)

The way to get character as the input using char data type.

For example 

#include<stdio.h>

int main

{

char a;//initialse the data type

scanf("%c",a)//getting the input from the user as a character

return o

}

In olden compliers like turbo c getchar  is used.

Welcome to OnlineGDB Q&A, where you can ask questions related to programming and OnlineGDB IDE and and receive answers from other members of the community.
...