WAP to convert text into its ASCII Code and also write a
function to decode the text given?

Answers were Sorted based on User's Feedback



WAP to convert text into its ASCII Code and also write a function to decode the text given?..

Answer / harish solanki

#include<stdio.h>
#include<conio.h>
void main()
{
char c,d;
int a;
clrscr();
printf("enter character");
scanf("%c",&c);
a=c;
d=a;
printf("the ascii code is:%d",a);
printf("the character is:%c",d);
getch();
}

Is This Answer Correct ?    6 Yes 1 No

WAP to convert text into its ASCII Code and also write a function to decode the text given?..

Answer / shashank mahabdi

to convert it into ascii code just assign the entered
variable to a int(integer)variabe e.g.
int i=a
which on printing i will gie 64 as the o/p

Is This Answer Correct ?    1 Yes 6 No

Post New Answer

More C Interview Questions

how does the C compiler interpret the following two statements p=p+x; q=q+y; a. p=p+x; q=q+y b. p=p+xq=q+y c. p=p+xq; q=q+y d. p=p+x/q=q+y

2 Answers   TCS, Tech Synergy,


Define function pointers?

1 Answers  


What is structure of c program?

0 Answers  


To find whether a number is even or odd without using any conditional operator??

12 Answers   College School Exams Tests, IBM,


What is difference between array and pointer in c?

0 Answers  






swap two integer variables without using a third temporary variable?

6 Answers   Persistent,


Give differences between - new and malloc() , delete and free() ?

0 Answers   Genpact,


Explain what happens if you free a pointer twice?

0 Answers  


Write a simple code fragment that will check if a number is positive or negative.

0 Answers  


How can I use a preprocessorif expression to ?

0 Answers  


What is the description for syntax errors?

0 Answers  


What are the different types of objects used in c?

0 Answers  


Categories