3.1.21

C program to convert char into int and int to char

#include <stdio.h>

#include <stdlib.h>

 

int main()

{

    char ch='B';

    int n=ch;

    printf("The ASCII code of the character %c is : %d\n",ch,n);

 

    return 0;

}

OUTPUT

The ASCII code of the character B is : 66


No comments:

Post a Comment

JAVA program pattern 2

import java.util.Scanner; public class pattern3 { public static void main(String args[]) { int i,j; Scanner sc=new Scanner(System.in); Syste...