A company wants to transmit data over the telephone, but it
is concerned that its phones may be tapped. All of its data
is transmitted as four-digit integers. It has asked you to
write a program that will encrypt its data so that the data
may be transmitted more securely. Your script should read a
four digit integer entered by the user in a prompt dialog
and encrypt it as follows: Replace each digit by (the sum
of that digit plus 7) modulus 10. Then swap the first digit
with the third, and swap the second digit with the fourth.
Then output XHTML text that displays the encrypted
integer.
Answer Posted / ferial hattar
#include<iostream.h>
void main()
{
int n,a,b,c,d,e,f,g,h,i,j;
cout<<"enter 4 number digit";
cin>>n;
a=n%10;
b=n/10;
c=b%10;
d=b/10;
e=d%10;
f=d/10;
g=((a+a)+7)%10;
h=((c+c)+7)%10;
i=((e+e)+7)%10;
j=((f+f)+7)%10;
cout<<i<<g<<j<<h;
}
| Is This Answer Correct ? | 11 Yes | 28 No |
Post New Answer View All Answers
what is the heat insulation material is adaptable for a flue gas duct that carries waste heat from brick kiln to brick drier and what temperature is required to maintain at the tunnel to dry adobe bricks adequately
Hi I want to know how API gravity has been come up with in Oil Industry, especially figures in the following formula: API=(141.5/SG)-131.5
A rectangular sheet dimensions a x b is to be made into an open-topped box by cutting a square of side h from each corner and folding the 4 sides up. Find the value of h which allows the maximum volume of the box?
What type of questions are asked in interview?
how to print a number in character(ex. 123= one twenty three)?
to print greatest of two integers without using >,<,=.
i m doing engg in IT .for getting job which courses i have to do?
difference between a for loop and a while loop? what are its uses in c language?
Sir, I was recently placed at ITC Infotect. My ctc is 2.46lpa. How much will I get in hand every month? Plssss answer. Thanx in advance.
What were the most energizing/enjoyable aspects of your job in this given period?
What experience have you had in working with field forces?
how i run the assembly language code
what is total power generation capacity in india at present (as on 12-12-2011)
Three pc now connected the 24 port switch.one pc ip adders 192.168.0.125,anather pc ip is 192.168.0.98, anather pc ip is 192.168.0.123, so 98 or 125 ping replay to 123,but 123 is not replay 125 or 98, but 123 is others pc ping replay,
i made lan connections ,then how can i establish the network....with that connections only is the network is established ...tell me the procedure for giving the lan connection for some(10) pc's?