Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...


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

Write a function in c to find the area of a triangle whose length of three sides is given.

2 Answers  


Which of the following sorts is quickest when sorting the following set: 1 2 3 5 4 1) Quick Sort 2) Bubble Sort 3) Merge Sort

7 Answers  


Can a pointer be static?

0 Answers  


Discuss similarities and differences of Multiprogramming OS and multiprocessing OS?

4 Answers   TCS,


Write a program that takes a 5 digit number and calculates 2 power that number and prints it.

1 Answers   Mind Tree,


difference between my-strcpy and strcpy ?

3 Answers   Geometric Software, IIM, Infosys,


Give a fast way to multiply a number by 7

15 Answers   Accenture, Aricent, Microsoft,


What do mean by network ?

0 Answers  


What is the difference between fread buffer() and fwrite buffer()?

0 Answers  


program for swapping two strings by using pointers in c language

1 Answers  


What are two dimensional arrays alternatively called as?

0 Answers  


Write a program to check whether a number is prime or not using c?

0 Answers  


Categories