Write a program to print the swapping in two no and using
three variable.

Answer Posted / manasa bugude

import java.util.Scanner;

public class SwappMethod {

public static void main(String[] args)
{
int a,b,c,d;
Scanner scn=new Scanner(System.in);
System.out.println("enter the value of a,b and c");
a=scn.nextInt();
b=scn.nextInt();
c=scn.nextInt();
System.out.println("before swapping numbers:"+a+" "+b+" "+c);
d=a;
a=b;
b=c;
c=d;
System.out.println("after swapping number:"+a+" "+b+" "+c);
System.out.println();

}

}

Is This Answer Correct ?    0 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

How do you convert stl to steps?

857


What is stl stack?

875


write a program to convert a decimal number in to its equivalent binary number?

2284


how can u do connectivity in c++ language? plz send me connectivity code in c++ ?

2106


a program using one dimensional array that searches a number if it is found on the list of given input numbers given by the user and locate its exact location in the list.

1621


When did c++ add stl?

953


What is the use of stl?

831


How stl is different from the c++ standard library?

863


What is a stl vector?

836


What are the various types of stl containers?

943


Is string part of stl?

957


How connect plc and pc through software

2177


What are the components of stl?

863


In what scenario does the Logical file and Physical file being used?

2551


Write a C/C++ program that connects to a MySQL server and checks if the InnoDB plug-in is installed on it. If so, your program should print the total number of disk writes by MySQL.

2191