USING C
#include<stdio.h>
#include<conio.h>
int main()
{
int x,y,z;
x=6;
y=6;
z=x*y;
printf(" the result of is: %d ", z);
// %d is use of integer type variables//
return 0;
}
USING JAVA
public static void main(String[] args)
{
int firstvalue = 6;
int secondvalue = 6;
int result = firstvalue * secondvalue ;
System.out.println(" the result of is: " + result);
}
..........................................................................................................
in both java and c the output will be
the summation is: 36
...........................................................................................................
IF WE WANT THE USER TO INPUT THE NUMBERS:
USING C
#include<stdio.h>
#include<conio.h>
int main()
{
int x,y,z;
printf("enter the first value:");
scanf("%d", &x);
printf("Enter the second value:");
scanf("%d", &y);
z=x*y;
printf(" the result of is: %d ", z);
// %d is use of integer type variables//
return 0;
}
USING JAVA
import java.util.Scanner;
{
static Scanner sc= new Scanner(System.in);
public static void main(String[] args)
{
int firstvalue;
int secondvalue;
System.out.print("Enter the first value:");
firstvalue= sc.nextInt();
System.out.print("Enter the Second value:");
secondvalue=sc.nextInt();
int result = firstvalue * secondvalue ;
System.out.println("the result of is:" + result);
}
}