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
Friends Any one tell me the best institute for the telecom protocol course
need tcs questn papers from 2007 to 2009 plzzzmail to 9015.rama@gmail.com its urgent
why one should join accenture?
Hi dost here Alok Kumar please send question pattern for NIC at godinall.kumar1@gmail.com or alok.iitb07@gmail.com
what should i say in the interview if interviewer asks me "why did you choose IT instead of your core group?"
compair and contrast procedrual and object oriented programming language
friends help me..am a btech fresher.. wt is the eligibility criteria for TCS???? like %...repli me clearly from x onwards..
how will u test the idoc
List three things you can do with the files you create by recording your voice on your computer
what is typa casting and type conversion ?
i want to know about the scope of IT engineers in ONGC
Key difference between ip10 and ip20 of ceragon equipment?
hi i am an CSE engg student and i cleared the PE exam of BEL 2012 both 24/07/012 and 01/08/2012 , so please if someone can help me with PE Interview question or subject or topics which i should cover that help me clear both Interview.PLZ help. my mail id is rjjkumar99@gmail.com
what is the effect of low frequency(say 48Hz) on TUrbo- Generator set when running for a prolonged period?
why only j2me is used for mobile???