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 is character constants?
What is the advantage of using #define to declare a constant?
1. Write a function to display the sum of two numbers in the following ways: By using (i) pass by value (ii) pass by address a. function with argument and with return value b. function with argument and without return value c. without argument , with return value d. without argument , without return value Note: Use pass by address.
How can you invoke another program from within a C program?
What is the use of ?
Are local variables initialized to zero by default in c?
What is advantage of pointer in c?
What is variable in c example?
What is the acronym for ansi?
What is the purpose of clrscr () printf () and getch ()?
List the different types of c tokens?
Sir,please help me out with the code of this question. Write an interactive C program that will encode or decode multiple lines of text. Store the encoded text within a data file, so that it can be retrieved and decoded at any time. The program should include the following features: (a) Enter text from the keyboard, encode the text and store the encoded text in a data file. (b) Retrieve the encoded text and display it in its encoded form. (c) Retrieve the encoded text, decode it and then display the decoded text. (d) End the computation. Test the program using several lines of text of your choice.
If fflush wont work, what can I use to flush input?
Apart from dennis ritchie who the other person who contributed in design of c language.
How can I direct output to the printer?