answersLogoWhite

0


Best Answer

The Answers community requested more information for this question. Please edit your question to include more context.

User Avatar

Wiki User

9y ago
This answer is:
User Avatar

Add your answer:

Earn +20 pts
Q: Difference the following getchar putchar
Write your answer...
Submit
Still have questions?
magnify glass
imp
Related questions

What loops does not need a counter?

Random example: while ((c= getchar()) != EOF) putchar (c);


Functions except gets and puts in c?

printf , scanf , getchar, putchar, getc are the other operators in C except gets and puts..


What is putchar function in c?

putchar used to write one character to output device Example putchar (variable_name); #include<stdio.h> void main() { char alpha='x'; clrscr(); putchar(alpha); putchar('\n'); /*or*/ putchar('\Y'); getch(); }


What is the purpose of a getchar function?

The getchar() function gets a single character from stdin. Here is a very basic example: #include <stdio.h> int main() { char ch; do { ch = getchar(); putchar(ch); } while (ch != ';'); return 0; } It reads from data you input and prints it again of the screen after you press key. It works until it reaches ";" symbol. The getchar() function is equivalent to getc(stdin).


What is the use of getchar?

gets()Reads characters from stdin and stores them as a string into str until a newline character ('\n') or the End-of-File is reached.The ending newline character ('\n') is not included in the string.getchar()Returns the next character from the standard input (stdin).It is equivalent to getc with stdin as its argument. === ===


How do you print in c 1 2 3 4 5 6?

Any of the following are snippets of code providing some ways of doing it: printf("1 2 3 4 5 6"); write(0, "1 2 3 4 5 6", 11); puts("1 2 3 4 5 6"); for (i = 0; i++ < 5; printf("%d ", i); printf("%d", i); for (i = 0; ++i < 6; putchar(' ')) putchar('0' + i); putchar('0' + i);


How do you skip a line in C program?

putchar ('\n');


Write a C program to make a vertical histogram?

/* Vertical Histogram of words in a Sentence */ #include<stdio.h> #define MAXWL 20 /* Maximum length of a word */ #define MAXNO 25 /* Maximum No of words in a sentence */ int main(void) { int word[MAXNO]; int i,c,j,nc,nw; for(i=0;i<MAXNO;++i) word[i]=0; nc = nw = 0; while( (c=getchar()) != EOF) { ++nc; if( c ==' ' c ==' ' c ==' ') { word[nw] = nc -1; /* -1 for excluding the space in the word length */ ++nw; nc = 0; /* resetting the word-length for the next word */ } } for( i = MAXWL; i >= 1; --i) { for(j=0;j <= nw;++j) { if( i <= word[j]) putchar('*'); else putchar(' '); } putchar(' '); } return 0; }


Will blank spaces be accepted in getchar?

yes


How is the getchar function used in a C program?

The getchar() is used in 'C' programming language because it can read the character from the Standard input(i.e..from the user keyboard),and converts in to the ASCII value.


How do you print double quote sign in c?

putchar ('"'); puts ("""); etc


How will you print percent in c language?

putchar ('%'); puts ("%"); printf ("%%"); etc...