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

What are the different types of stl containers?

793


Why should a c++ programmer be interested in stl?

784


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

781


What does stl stand for in basketball?

791


What is a stl vector?

764






What is a standard template library (stl)?

773


What two types of containers does the stl provide?

710


What is stl stack?

792


What is stl stand for?

875


How does an stl file work?

800


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.

1533


Name the different types of stl containers.

845


Do you like to Submit Questions in Bulk under Same Category?? Then use our Bulk ListerDo you like to Submit Questions in Bulk under Same Category?? Then use our Bulk Lister

1808


When did c++ add stl?

886


To modify an, existing worksheet. What steps are involved for: 1. Inserting and deleting rows and columns. 2. Printing cell formulas 3Jld displayed values 3. Using the page setup command

1922