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


Please Help Members By Posting Answers For Below Questions

2. Tell me about a time when you had to use your presentation skills to influence someone's opinion.

1648


can 25mm thik and 8.5x8.5 size cast iron plate can bear a weight of 250 tons if it can what would be the compostion

1397


What experience have you had in writing technical materials?

1668


If you have two 132KV distance scheme and you are using fibre for comms but the two relays on are not compatible interms of comms what can you use to allow communication between the two relays.

1555


Hi dost here Alok Kumar please send question pattern for NIC at godinall.kumar1@gmail.com or alok.iitb07@gmail.com

1518






compare the conditional operator with if-else-if statement.

1517


Based on the Job Description above, please indicate in details why you are a good match for this position?

1583


95) func(a,b) int a,b; { return( a= (a==b) ); } main() { int process(),func(); printf("The value of process is %d ! ",process(func,3,6)); } process(pf,val1,val2) int (*pf) (); int val1,val2; { return((*pf) (val1,val2)); please help me in detail ....with flowchart

1483


what is the definition(body) of a default constructor in c++?

1553


Difference between software process model and software process.?

1568


can i get some win vista notes

1357


how the class is instance of object?

2057


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?

810


What does "stdafx"header file do?

1534


How we calculate the recovery of steam as per coal in a boiler if we know the calorific value of coal?

1460