Write a program to accept a character & display its
corrosponding ASCII value & vice versa?

Answer Posted / pansare sandeep

#include <iostream.h>
#include<conio.h>
void main()
{
char c;
int d;
clrscr();
cout<<"Enter any key"<<endl;
cin>>c;
d=c;
cout<<"Corresponding ascii is "<<d;
getch();
}

Is This Answer Correct ?    11 Yes 6 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Explain how can I pad a string to a known length?

856


Describe the header file and its usage in c programming?

786


Do pointers store the address of value or the actual value of a variable?

790


Explain what is a 'null pointer assignment' error? Explain what are bus errors, memory faults, and core dumps?

820


Why enum is used in c?

685






Why does notstrcat(string, "!");Work?

857


Can we compile a program without main() function?

833


What are file streams?

744


c program for searching a student details among 10 student details

1832


What are terms in math?

763


Explain how can I write functions that take a variable number of arguments?

772


What is s or c?

768


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

1664


What is FIFO?

1036


What is the process of writing the null pointer?

754