Tuesday, February 9, 2016

Using character variable in C program.

#include<stdio.h>
int main()
{
  char ch;

  printf("Enter your grade:");
  scanf("%c", &ch);

  printf("Your grade is %c",ch);
  return 0;
}

Output of program

Enter your grade:A
Your grade is A



No comments:

Post a Comment