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

Print all numbers which has a certain digit in a certain position eg: number=45687 1 number=4 2 number=5 etc

4 Answers  


Which is the memory area not included in C program? give the reason

0 Answers   IBM, TCS,


what is the difference between strcpy() and memcpy() function?

2 Answers  


How is a null pointer different from a dangling pointer?

0 Answers  


What is a example of a variable?

0 Answers  






what is the difference between north western polytechnique university and your applied colleges?? please give ur answers for this. :)

0 Answers  


What is the -> in c?

0 Answers  


in a town the percentage of men is 52 the percentage of total literacy is 48 if total percentage of literate men is 35 of the total population write a program to find the total no of the literate men and women if the population of the town is 80000

3 Answers  


How to compare array with pointer in c?

0 Answers  


code snippet for creating a pyramids triangle ex 1 2 2 3 3 3

4 Answers  


what is the code to display color fonts in the output?

1 Answers  


enum DAY { sunday, monday, tuesday }; enum EDAYS { friday, saturday, sunday }; void main() { int i =0; if( i == sunday) { printf("%d",i); } } what would be the output?

4 Answers   TCS,


Categories