Friday, 25 May 2012

putch() and putchar() function

Unformatted single character output function


putch() function

We use this function for printing a single character value. 

syntex
    
         putch(char variable);

int main()
{
    char ch;
    printf("enter value of ch  ");
    ch =getch();
    printf("\n value of ch is \t ");
    putch(ch);
}

Input      enter value of ch a 
                  then don't need to hit enter
Output   value of ch is        a




putchar() function

We use this function for printing a single character value. 

syntex
    
         putchar(char variable);

int main()
{
    char ch;
    printf("enter value of ch  ");
    ch =getch();
    printf("\n value of ch is \t ");
    putchar(ch);
}

Input      enter value of ch a 
                  then don't need to hit enter
Output   value of ch is        a

Read latest blog

3 comments:

  1. Then wat is d difference between using putch putchar

    ReplyDelete
  2. you must be so intelligent 😂

    ReplyDelete