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.


No Answer is Posted For this Question
Be the First to Post Answer

Post New Answer

More C Interview Questions

Find MAXIMUM of three distinct integers using a single C statement

0 Answers  


O,T,T,F,F,S,S,E,N,?,?,?,T,F,F,S,S,E,N

9 Answers   ADP,


Write a C/C++ program that connects to a MySQL server and displays the global TIMEZONE.

0 Answers  


write a c program to find largest number in matrix(in each row,each column, diagonally, and in the whole matrix)? Its urgent.

2 Answers  


what is the answer for it main() { int i; clrscr(); printf("%d",&i)+1; scanf("%d",i)-1; }

3 Answers  






write an interactive program to generate the divisors of a given integer.

7 Answers   TCS,


int i; i=2; i++; if(i=4) { printf(i=4); } else { printf(i=3); } output of the program ?

15 Answers   Mascot,


Which header file is essential for using strcmp function?

0 Answers  


why TCS selected more student in the software field from all institution.

5 Answers   TCS,


How do you write a program which produces its own source code as its output?

2 Answers  


what is the meaning of 'c' language

3 Answers  


Describe the modifier in c?

0 Answers  


Categories