# Input: Two even integers. Output: Average of those numbers.

Input: Two even integers.
Output: Average of those numbers.

answered Aug 5, 2019 by (220 points)
#include<stdio.h>
void main()
{
int a, b,c;
scanf("%d %d",&a,&b);
if(a%2==0&&b%2==0)
{
c=(a+b)/2;
printf("%d",c);

}
}
commented Aug 8, 2019 by (140 points)
average of odd number is also possible
answered Aug 6, 2019 by Gattu
# in python

n = int(input("please enter any even number :"))

m = int(input("please enter any even number :"))

if (((n % 2) == 0 ) and ((m % 2) == 0)):

print(" average of numbers is : {0}".format((n+m)/2))

else:

print("enter even numbers")
answered Aug 8, 2019 by (150 points)
for (c++)

#include <iostream>
using namespace std;
int main(){
int a,b;
cin>>a>>b;
cout<<(a+b)/2;
return 0;
}
answered Aug 8, 2019 by (140 points)

#include <stdio.h>

int main(void)

{

int a,b;

float c;

printf("Enter two numbers")

scanf("%d%d',&a,&b);

c=(float)(a+b)/2;

printf("average of two integers numbers is=%d",c);

return 0;

}

answered Aug 8, 2019 by anonymous
#include<stdio.h>

int main()

{

int a,b;

scanf("%d%d",&a,&b);

printf("average=%d",(a+b)/2);

return 0;

}
answered Aug 10, 2019 by anonymous
a = input().split(' ')
print((int(a[0]) + int(a[1]))/2)

#Example Input: 2 5

#output = 3.5
answered Aug 11, 2019 by anonymous
//in C

#include<stdio.h>
void main()
{
int a,b,c;
printf("Enter the two even numbers:");
scanf("%d,%d",&a,&b);
c=(a+b)/2;
if(a%2==0&&b%2==0)printf("%d",c);

}
answered Aug 11, 2019 by (180 points)
import java.util.Scanner;
public class Main
{
int c;
void even(int a,int b)
{
if(a%2==0&&b%2==0)
{
c=(a+b)/2;
System.out.print(c);
}
else
{
System.out.print("not a even num");
}
}
public static void main(String[] args) {
int a,b;
Scanner sc=new Scanner(System.in);
a=sc.nextInt();
b=sc.nextInt();
Main k=new Main();
k.even(a,b);
}
}