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.
Login
Login
OnlineGDB Q&A
Questions
Unanswered
Tags
Ask a Question
Ask a Question
Write a C program to get a character from the user using getchar() and print it using printf().
0
votes
asked
Feb 13, 2018
by
anonymous
the complete program for this question
Your answer
Your name to display (optional):
Email me at this address if my answer is selected or commented on:
Email me if my answer is selected or commented on
Privacy: Your email address will only be used for sending these notifications.
Anti-spam verification:
To avoid this verification in future, please
log in
or register.
4 Answers
0
votes
answered
Feb 13, 2018
by
anonymous
the sample input is *
the sample output is *
Your comment on this answer:
Your name to display (optional):
Email me at this address if a comment is added after mine:
Email me if a comment is added after mine
Privacy: Your email address will only be used for sending these notifications.
Anti-spam verification:
To avoid this verification in future, please
log in
or register.
–1
vote
answered
Feb 13, 2018
by
anonymous
#include<stdio.h>
int main()
{
char *;
*=getchar();
printf("getchar()"');
return0;
}
commented
Feb 14, 2018
by
Sushmeetha Reddy
(
100
points)
here,*is not a variable right.how does it stores?
Your comment on this answer:
Your name to display (optional):
Email me at this address if a comment is added after mine:
Email me if a comment is added after mine
Privacy: Your email address will only be used for sending these notifications.
Anti-spam verification:
To avoid this verification in future, please
log in
or register.
+1
vote
answered
Feb 13, 2018
by
Mayur Warpe
(
160
points)
#include<stdio.h>
void main()
{
char c;
c=getchar();
//to print the same character using printf...
printf("%c",c);
}
Your comment on this answer:
Your name to display (optional):
Email me at this address if a comment is added after mine:
Email me if a comment is added after mine
Privacy: Your email address will only be used for sending these notifications.
Anti-spam verification:
To avoid this verification in future, please
log in
or register.
0
votes
answered
Feb 14, 2018
by
niraj singh
(
140
points)
int main()
{
char var;
var=getchar();
printf("getchar() = %c",var);
return 0;
}
Your comment on this answer:
Your name to display (optional):
Email me at this address if a comment is added after mine:
Email me if a comment is added after mine
Privacy: Your email address will only be used for sending these notifications.
Anti-spam verification:
To avoid this verification in future, please
log in
or register.
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.
...