Thursday, May 2, 2019

ASCII code

  • Problem Description

    Write a C program to generate ASCII code for a given character.
  • Test Case 1

    Input (stdin)
    C

    Expected Output
    67
  • Test Case 2

    Input (stdin)
    Z

    Expected Output
    90
Solution

#include <stdio.h>
int main()
{
char a;
  scanf ("%c",&a);
  printf ("%d",a);
return 0;
}

No comments:

Post a Comment

Parity

Problem Description Ram and Sita playing the parity game. Two types of parity are there. One is odd parity and next is even parity. Ram will...