Monday 10 July 2017

Putchar

Putchar 'C 'Output Function 

Putchar write a character to standard output (monitor). It takes argument as character and returns its integer form without sign. If a writing error occurs, EOF is returned and the error indicator (ferror) is set.
#include<stdio.h>
void main()
{
     char ar[]={"Girfa"};

Sunday 9 July 2017

Getchar

Getchar Function

Getchar takes input a character from standard input (stdin) and return integer value without sign.

int main(void)
{
   int c;

   /* Note that getchar reads from stdin and

Saturday 8 July 2017

getche

Getche function

Getche is same as getch function, both takes input from keyboard the difference is return type.
  • Getch does not echo given character only return integer value
  • Getche  echo and return integer code of given character

#include<stdio.h>
void main()
{
    char n;

Getch

Getch takes input a character from keyboard.  Getch is different from scanf because user need to press enter explicitly to complete input process but getch intensely return pressed key ASCII.

Some people used getch  to hold program output because when getch excuted it wait for a character and until user press a character next statement would not get executed.