answersLogoWhite

0

If you are referring to getchar(), it returns a single character as an 'int'.

'scanf' allows the user to input many different types of variables, and converts them accordingly using a format specified by the user.

If you type 'man getchar' and 'man scanf' you will get additional information on how to use them.

User Avatar

Wiki User

15y ago

What else can I help you with?

Continue Learning about Engineering

Can you replace getch of C programming in Linux without using iostream header?

There is a 'getch' in 'conio.h' which has nothing to do with 'iostream'.


Why getch function has semicolen?

Without the semi-colon, getch is just an expression, not a statement.


What is the purpose of getch()?

getch() is a way to get a user-inputted character. It can be used to hold program execution, but the "holding" is simply a side-effect of its primary purpose, which is to wait until the user enters a character. getch() and getchar() are used to read a character from screen.


What is difference between getchar and getch?

Both getch() and getche() are used to read single character there is very little difference -getch() doesn't display output to screen if used without lvalue -getche() display output to screen even if used without lvalue following example will clear this..... 1. main() { getch(); } 2. main() { getche(); } after running above programs............... when you press any key, you'll exit from output screen verify the output by pressing alt+F5 1. will not show anything 2.will show the key you were pressed...... hope you get it............. __________________________________________________________________ getch() - get character from screen without echo and compiler didn't wait for another key. getche() - get character from screen and compiler didn't wait for another key getchar() - get character from screen and compiler wait for another key and moreover it returns a integer value i.e. the ASCII(American Standard Code for Information exchange) which we can use where ever we want.for example:- mostly in encryption. In this the major concept is of echoing and it is nothing but when we enter anything through keyboard and if it is coming back on the screen (even if to show that what we are entering ) that's called echoing. and this is what makes difference in getch() and getche()


How to write printf statements for print 1.234 in a 9-digit field with preceding zeros?

#include<stdio.h> #include<conio.h> void main() { char b=0; float a; clrscr(); a=1.234; printf("\n%d%d%d%d%.3f",b,b,b,b,a); getch(); }

Related Questions

Purpose of getch?

The purpose of getch() is to input a single character from the input stream.


Can you replace getch of C programming in Linux without using iostream header?

There is a 'getch' in 'conio.h' which has nothing to do with 'iostream'.


Why getch function has semicolen?

Without the semi-colon, getch is just an expression, not a statement.


Return value of getch?

char


How you use getch in ubuntu Linux?

Quote taken from The Unix and Linux Forum: getch() is an ancient DOS syscall from even older versions of Borland Turbo C. Mostly nothing has it these days. Unquote. Search Google with "getch" and have a look through the webpages on the subject. There are no manual (man) pages for getch - I'm using Ubuntu 12.04.


What is the purpose of getch()?

getch() is a way to get a user-inputted character. It can be used to hold program execution, but the "holding" is simply a side-effect of its primary purpose, which is to wait until the user enters a character. getch() and getchar() are used to read a character from screen.


What use getch function in c language?

Gets one character (or keystroke) without buffering or echoing; beware: getch is not part of the standard library.


What is the use of getch in C programming?

We use getch() function to hold the screen so that we can see the output but in real it is use to take a input of a character from the console window. Read this out -


What is difference between getchar and getch?

Both getch() and getche() are used to read single character there is very little difference -getch() doesn't display output to screen if used without lvalue -getche() display output to screen even if used without lvalue following example will clear this..... 1. main() { getch(); } 2. main() { getche(); } after running above programs............... when you press any key, you'll exit from output screen verify the output by pressing alt+F5 1. will not show anything 2.will show the key you were pressed...... hope you get it............. __________________________________________________________________ getch() - get character from screen without echo and compiler didn't wait for another key. getche() - get character from screen and compiler didn't wait for another key getchar() - get character from screen and compiler wait for another key and moreover it returns a integer value i.e. the ASCII(American Standard Code for Information exchange) which we can use where ever we want.for example:- mostly in encryption. In this the major concept is of echoing and it is nothing but when we enter anything through keyboard and if it is coming back on the screen (even if to show that what we are entering ) that's called echoing. and this is what makes difference in getch() and getche()


How to write printf statements for print 1.234 in a 9-digit field with preceding zeros?

#include<stdio.h> #include<conio.h> void main() { char b=0; float a; clrscr(); a=1.234; printf("\n%d%d%d%d%.3f",b,b,b,b,a); getch(); }


What is the function key that is used to display the result in the output screen?

getch();


Give an code for getch?

#include <conio.h> #include <stdio.h> int mygetch (void) { int x; x= getch (); if (x==0) x= 1000+getch(); return x; } int main (void) { int key; key = mygetch (); if (key==1059) printf ("F1\n"); else printf ("%d\n", key); return 0; }