Example
#include<stdio.h>
#include<conio.h>
void main()
{
char a;
int b;
clrscr();
printf("Enter the character:");
scanf("%c",&a);
printf("ASCII value of character is:%d",a);
getch();
}
/*========================================================================
OUTPUT
Enter the character:a
ASCII value of character is:97
*/
#include<stdio.h>
#include<conio.h>
void main()
{
char a;
int b;
clrscr();
printf("Enter the character:");
scanf("%c",&a);
printf("ASCII value of character is:%d",a);
getch();
}
/*========================================================================
OUTPUT
Enter the character:a
ASCII value of character is:97
*/
No comments:
Post a Comment