Canna

Tuesday, 25 September 2018

Pointer - 2

  • Problem Description

    Write a program to enter a lowercase character. Print this character in uppercasa and also display its ASCII value

    Input and Output Format:

    Refer sample input and output for formatting specification.

    All float values are displayed correct to 2 decimal places.

    All text in bold corresponds to input and the rest corresponds to output.


  • Test Case 1

    Input (stdin)
    c
    
    
    Expected Output
    The ASCII value is:99
    
    The uppercase letter is:C
  • Test Case 2

    Input (stdin)
    a
    
    
    Expected Output
    The ASCII value is:97
    
    The uppercase letter is:A
  • Program
  • #include <stdio.h>
    int main()
    {
    char c; 
    scanf("%c",&c);
    printf("The ASCII value is:%d\n",c); 
    printf("The uppercase letter is:%c",c-32);
     
     return 0;
    }

No comments:

Post a Comment

Note: only a member of this blog may post a comment.