******** In Algorithm ********
Algorithm Variables m,n,p :real Begin write(" Enter a number :") read(m) write(" Entrer a number :") read(n) p = m * n write("the product of ",m,"and",n,"=",p) end Result ==> Enter a number : 7 Enter a number :3 the product of 7 and 3 = 21
******** In C ********
#include <stdio.h> int main() { float m,n,p ; printf(" Enter a number :"); scanf("%f",&m); printf(" Enter a number :"); scanf("%f",&n); p = m*n ; printf("the product of %f and %f = %f",m,n,p); return 0 ; }
******** In C++ ********
#include <iostream>
using namespace std;
int main() {
float m,n,p ;
cout<<" Enter a number :"; cin>>m ;
cout<<" Enter a number :"; cin>>n ;
p = m*n ;
cout<<"the product of "<<m<<" and "<<n<<" = "<<p ;
return 0 ;
}
******** in Python ********
******** in Python ********
m = float(input(" Enter a number:"))
n = float(input(" Enter anumber:"))
p = m*n
print("the product of ",m,"et",n,"=",p)
******** 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 number :");
float n = sc.nextFloat();
System.out.print("Enter a number :");
float m = sc.nextFloat();
System.out.println("the product of "+m+ " and "+n+" = "+n*m);
}
}
********** in C# *******
using System;
public class Ex2 {
public static void Main(string[] args)
{ float m,n;
Console.Write("Enter N1:");
m=float.Parse(System.Console.ReadLine());
Console.Write("Enter N2:");
n=float.Parse(System.Console.ReadLine());
Console.WriteLine ("the product of"+m+" et "+n+" = : "+n*m);
}
}
class Main {
public static void main(String[] args) {
Scanner sc = new Scanner (System.in);
System.out.print("Enter a number :");
float n = sc.nextFloat();
System.out.print("Enter a number :");
float m = sc.nextFloat();
System.out.println("the product of "+m+ " and "+n+" = "+n*m);
}
}
using System;
public class Ex2 {
public static void Main(string[] args)
{ float m,n;
Console.Write("Enter N1:");
m=float.Parse(System.Console.ReadLine());
Console.Write("Enter N2:");
n=float.Parse(System.Console.ReadLine());
Console.WriteLine ("the product of"+m+" et "+n+" = : "+n*m);
}
}