#include <stdio.h>

/* Function declarations */
char ToUpper(char inchar);
 
/* Function main:                                                  */
/* Prompt for a line of text, Read one character, uppercase it,    */
/* print it out, then get another                                  */
main()
{
  char echo;                             /* Input character        */
  char upcase;                           /* Converted character    */

  printf("Input a line of text : ");

  do {
    scanf("%c", &echo);
    upcase = ToUpper(echo);
    printf("%c%", upcase);
  }
  while (echo != '\n');
}


/* Function ToUpper:                                               */
/* If the parameter is lower case return its uppercase ASCII value */
char ToUpper(char inchar)
{
  int outchar;

  outchar = inchar;

  if ('a' <= inchar && inchar <= 'z')
    outchar = inchar - ('a' - 'A');

  return outchar;
}