import java.util.Scanner;
public class encryption
{
public static void main (string[] args)
{
int temp, first,second, third, fourth,encryped;
int a = first,b = second,c = third, d = fourth;
int a = c,c = a;
int b = d,d = b;
System.out.println("After swapping a = " + a + "c = " + c)+System.out.println("After swapping c = " + c + "a = " + a)
System.out.println("After swapping b = " + b + "d = " + d)+System.out.println("After swapping d = " + d + "b = " + b)
}
double integer;
Scanner scan = new Scanner (System.in);
System.out.print("Enter a four digit integer:");
while (integer>0)
{
temp = integer % 1000;
temp+7;
first = temp % 10;
temp = integer % 1000;
temp % 100;
temp+7;
second = temp % 10;
temp = integer % 1000;
temp % 100;
temp & 10;
temp+7;
third = temp % 10;
temp = integer % 1000;
temp % 100;
temp & 10;
temp+7;
fourth = temp % 10;
new second = fourth;
first = new third * 1000;
third = temp * 10;
temp = new second;
new second = new fourth * 100;
fourth integer = temp;
encrypted = first integer + second integer + third integer + fourth integer;
}
System.out.println("The Encrypted number is:");
System.in.println("Four digit number:");
}
cameclifton
0
Newbie Poster
Recommended Answers
Jump to Postcan u compile your code.it has some errors like temp +7 and staff..not statements;
.it will be much easier to see the problem if u do that first.
All 4 Replies
zyaday
0
Junior Poster in Training
BestJewSinceJC
700
Posting Maven
cameclifton
0
Newbie Poster
BestJewSinceJC
700
Posting Maven
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.