Write a program  that asks the user for two numbers  M  and N and then informs him if the product of these two numbers is positive or negative. The case where the product can be null is included in the program.

******** In Algorithm ********

Algorithm Variables m,n: reals Begin write(" Enter a number :") read(m) write(" Enter a number:") read(n) if( n == 0 or m == 0) then write("the product is null !!") next if( m*n < 0) then Ecrire("the product is negative") next if( m*n > 0) then Ecrire("the product is positive ") next End Result ==> Enter a number : -7.4 Enter a number : 2 the product is negative

******** In C ********

#include <stdio.h> int main() { float m,n ; printf(" Enter a number :"); scanf("%f",&m); printf(" Enter a number :"); scanf("%f",&n); if( n == 0 || m == 0) printf("the product is null !!"); if ( m*n < 0) printf("the product is negative" ); if ( m*n > 0) printf("the product is positive " ); return 0; }

******** In C++ ********

#include <iostream> using namespace std; int main() { float m,n ; cout<<" Enter a number:"; cin>>m; cout<<" Enter a number:"; cin>>n; if( n == 0 || m == 0) cout<<"the product is null!!"; if ( m*n < 0) cout<<"the product is negative "; if ( m*n > 0) cout<<"the product is positive "; return 0; }

******** in Python ********

A = float(input("Enter an integer A:")) B = float(input("Enter an integer B:")) if A*B < 0 : print("the product of ",A,"and",B,"is negative") elif A*B > 0: print("the product of ",A,"and",B,"is positive") else : print("the product ",A,"et",B," is null ")

******** in JAVA ********

import java.util.Scanner;
class Main {
public static void main(String[] args) {
Scanner sc = new Scanner (System.in);
System.out.print("Enter m:");
int m = sc.nextInt();
System.out.print("Enter n:");
int n = sc.nextInt();
if( n == 0 || m == 0)
  System.out.print("the product of null!!");
if ( m*n < 0)
    System.out.print("the product is negative" );
if ( m*n > 0) 
   System.out.print("the product is positive" );
}
}


********* En C# *******

using System;
public class Ex7 {
public static void Main(string[] args)
{ float m,n;
Console.Write("Entrer m:");
m=float.Parse(System.Console.ReadLine());
Console.Write("Entrer n:");
n=float.Parse(System.Console.ReadLine());
if (n*m <0 )
Console.WriteLine ("the product is negative");
if (n*m>0)
Console.WriteLine ("the product is positive");
if (n*m==0)
Console.WriteLine ("the product is null");
}
}