Write a program to accept a character & display its
corrosponding ASCII value & vice versa?
Answer Posted / pawankumar
#include<stdio.h>
#include<conio.h>
void main()
{
clrscr();
int x;
char y;
printf("enter the number");
scanf("%d",&x);
printf("enter the char");
scanf(" %c",&y);
if(sizeof(x)==4)
{
printf("the equivalent char for given
integer is %c ",x);
}
if(sizeof(y)==1)
{
printf("the equivalent integer for given
char is %d ",y);
}
}
| Is This Answer Correct ? | 8 Yes | 15 No |
Post New Answer View All Answers
What is the benefit of using an enum rather than a #define constant?
Explain built-in function?
Why double pointer is used in c?
List the difference between a 'copy constructor' and a 'assignment operator' in C?
What’s a signal? Explain what do I use signals for?
What is main return c?
What is the purpose of & in scanf?
What is this infamous null pointer, anyway?
Why c is faster than c++?
What is actual argument?
What is structure in c explain with example?
Can we access array using pointer in c language?
ATM machine and railway reservation class/object diagram
Give a one-line C expression to test whether a number is a power of 2. [No loops allowed - it's a simple test.]
What is the best way to store flag values in a program?