Write a program to accept a character & display its
corrosponding ASCII value & vice versa?
Answer Posted / ashokan m
#include<stdio.h>
#include<conio.h>
main()
{
clrscr();
int x;
char y;
printf("enter the number");
scanf("%d",&x);
printf("enter the char");
scanf("%c",&y);
if(sizeof(x)==2))
{
printf("the equivalent char for given integer is %c ",x);
}
elseif(sizeof(y)==1)
printf("the equivalent integer for given char is %d ",y);
getch();
}
| Is This Answer Correct ? | 38 Yes | 52 No |
Post New Answer View All Answers
What are the different categories of functions in c?
program for reversing a selected line word by word when multiple lines are given without using strrev
What is the difference between specifying a constant variable like with constant keyword and #define it? i.e what is the difference between CONSTANT FLOAT A=1.25 and #define A 1.25
Can you please explain the difference between syntax vs logical error?
typedef enum { html, java, javascript, perl, cgi } lang;The above statement defines a : a) Union b) User defined type c) Enumerated variable d) none
What is volatile variable how do you declare it?
How to get string length of given string in c?
What is far pointer in c?
Compare array data type to pointer data type
What is the difference between the local variable and global variable in c?
What are the 4 types of organizational structures?
difference between native and cross compilers
Tell me when would you use a pointer to a function?
Where static variables are stored in c?
How do you initialize pointer variables?