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


Please Help Members By Posting Answers For Below Questions

main(){char *str;scanf("%s",str);printf("%s",str); }The error in the above program is: a) Variable 'str' is not initialised b) Format control for a string is not %s c) Parameter to scanf is passed by value. It should be an address d) none

699


Write a Program to accept different goods with the number, price and date of purchase and display them

5384


What functions are in conio h?

635


What does main () mean in c?

589


What are formal parameters?

619






Which is best linux os?

532


Write a code of a general series where the next element is the sum of last k terms.

562


why wipro wase

1804


Write a program to generate random numbers in c?

632


What is maximum size of array in c?

555


What is the right type to use for boolean values in c? Is there a standard type?

538


How can I pad a string to a known length?

591


What does the format %10.2 mean when included in a printf statement?

1052


Hai,I have done with my bachelor of commerce and planing to ms,please suggest me how to convince vo for shifting from commerce to computers. Visa on 8 DEC 2014  Npu university

1573


Write a function expand(s1,s2) that expands shorthand notations like a-z in the string s1 into the equivalent complete list abc...xyz in s2 . Allow for letters of either case and digits, and be prepared to handle cases like a-b-c and a-z0-9 and -a-z. z-a:zyx......ba -1-6-:-123456- 1-9-1:123456789987654321 a-R-L:a-R...L a-b-c:abbc

5027