putchar - C stdio.h

C examples for stdio.h:putchar

Type

function

From


<cstdio>
<stdio.h>

Description

Write character to stdout

Prototype

int putchar ( int character );

Parameters

ParameterDescription
character The character.

Return Value

On success, the character written is returned.

On error, EOF is returned and the error indicator (ferror) is set.

Example

This program writes ABCDEFGHIJKLMNOPQRSTUVWXYZ to the standard output.

Demo Code


#include <stdio.h>

int main ()//from  w  w w .  jav  a2  s .c  o m
{
  char c;
  for (c = 'A' ; c <= 'Z' ; c++)
     putchar (c);

  return 0;
}

Related Tutorials