******** In Algorithm ********
Algorithm Variables A,B,help :integers Begin Write("Enter an integer A:") read (A) Write("Enter an integer B:") read (B) help = A A = B B = help Write("the content of A is :",A) Write("the content of B is :",B) End Result ==> Enter an integer A : 8 Enter an integer B : 3 the content of A is : 3 the content of B is : 8
******** In C ********
#include <stdio.h> int main() { int A,B ,help; printf("Enter an integer A:"); scanf("%d",&A); printf("Enter an integer B:"); scanf("%d",&B); help = A ; A = B ; B = help ; printf("the content of A is:%d\n",A); printf("the content of B is:%d",B); return 0 ; }
******** In C++ ********
#include <iostream>
using namespace std;int main() {
int A,B ,help; cout<<"Enter an integer A:"; cin>>A;
cout<<"Enter an integer B:"; cin>>B;
help = A ;
A = B ; B = help ;
cout<<"the content of A is "<<A;
cout<<"the content of A is "<<B;
return 0 ;
}
******** in Python ********
******** in Python ********
m = int(input(" Enter m :"))
n = int(input(" Entrer n :"))
print("the content of m is",m)print("the content of n is",n)m,n=n,mprint("the content of m is",m)print("the content of n is",n)
******** in JAVA ********
import java.util.Scanner;class Main {
public static void main(String[] args) {
Scanner sc = new Scanner (System.in);
System.out.print("Enter A:");
float A = sc.nextInt();
System.out.print("Enter B:");
float B = sc.nextInt();
float auxilaire = A ; A = B ;
B = auxilaire ;
System.out.println("the content of is : "+A+"\n");
System.out.print("the content of B is: "+B);
}
}
public static void main(String[] args) {
Scanner sc = new Scanner (System.in);
System.out.print("Enter A:");
float A = sc.nextInt();
System.out.print("Enter B:");
float B = sc.nextInt();
float auxilaire = A ; A = B ;
B = auxilaire ;
System.out.println("the content of is : "+A+"\n");
System.out.print("the content of B is: "+B);
}
}
********* in C# *******
using System;
public class Ex3 {
public static void Main(string[] args)
{ float A,B,aux;
Console.Write("Enter A:");
A=float.Parse(System.Console.ReadLine());
Console.Write("Enter B:");
B=float.Parse(System.Console.ReadLine());
aux= A ; A=B ; B = aux ;
Console.WriteLine ("the content of A is"+ A);
Console.WriteLine ("the content of B is"+ B);
}
}
using System;
public class Ex3 {
public static void Main(string[] args)
{ float A,B,aux;
Console.Write("Enter A:");
A=float.Parse(System.Console.ReadLine());
Console.Write("Enter B:");
B=float.Parse(System.Console.ReadLine());
aux= A ; A=B ; B = aux ;
Console.WriteLine ("the content of A is"+ A);
Console.WriteLine ("the content of B is"+ B);
}
}