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
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
Write a Program to accept different goods with the number, price and date of purchase and display them
What functions are in conio h?
What does main () mean in c?
What are formal parameters?
Which is best linux os?
Write a code of a general series where the next element is the sum of last k terms.
why wipro wase
Write a program to generate random numbers in c?
What is maximum size of array in c?
What is the right type to use for boolean values in c? Is there a standard type?
How can I pad a string to a known length?
What does the format %10.2 mean when included in a printf statement?
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
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