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
Do you have any tips for using 3G phones?
differance between radix sort and radix exchange sort
AD backups and restoration
What will be the sql query to list the employee names those are getting 3rd highest salary ?
when will the group1&group2 exams will be held
how to convert postfix notation into prefix in data structures. please send me algo of taha
why every computer should have a boot strap routine?
funtionalities of loadining and linking
how i run the assembly language code
what are the areas of improvement required in yourself to achieve your career goals? Describe what you are doing/plan to do to address the areas of improvement
int main() { int d = 10; int m = 2; int y = 3603; int c = 0; int val; val = ( d + m + y + (y/4) + c) % 7; cout << val; return 0; }
why unix commands simpler rather than complex task
i want to know details about SBI bank exam and date when to apply and what is the eligibility and the model papers related to it and various post available for Engineering in Information Technology.
What experience have you had in working with field forces?
performance test required for a automatic bank teller?