WAP to convert text into its ASCII Code and also write a
function to decode the text given?
Answer Posted / 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 |
Post New Answer View All Answers
What is s or c?
What is the code for 3 questions and answer check in VisualBasic.Net?
Explain what does the format %10.2 mean when included in a printf statement?
Write a C program in Fibonacci series.
How can I recover the file name given an open stream or file descriptor?
write an interactive C program that will encode or decode a line of text.To encode a line of text,proceed as follows. 1.convert each character,including blank spaces,to its ASCII equivalent. 2.Generate a positive random integer.add this integer to the ASCII equivalent of each character.The same random integer will be used for the entire line of text. 3.Suppose that N1 represents the lowest permissible value in the ASCII code,and N2 represents the highest permissible value.If the number obtained in step 2 above(i.e.,the original ASCII equivalent plus the random integer)exceeds N2,then subtract the largest possible multiple of N2 from this number,and add the remainder to N1.Hence the encoded number will always fall between N1 and N2,and will therefore always represent some ASCII character. 4.Dislay the characters that correspond to the encoded ASCII values. The procedure is reversed when decoding a line of text.Be certain,however,that the same random number is used in decodingas was used in encoding.
What are the three constants used in c?
What is an identifier?
What is a pointer in c plus plus?
Which is best linux os?
What are control structures? What are the different types?
When should structures be passed by values or by references?
Is fortran faster than c?
develop algorithms to add polynomials (i) in one variable
What is the difference between near, far and huge pointers?