Computer Science, asked by anilkumarbagli9631, 10 months ago

WAP to input two integers and if both are even find their sum else find their product using conditional operator


QGP: Which Programming Language do you want it in?
arjttps03: Yes I also want to know

Answers

Answered by gurukulamdivya
1

Answer:

#include <stdio.h>

int main()

{

   int sum=0, pro=1, num1, num2;

    printf("Enter any two number to find its factor: ");

   scanf("%d%d", &num1, &num2);

    if (num1%2==0 && num2%2==0)

  {

       sum=num1+num2;

       printf("sum of both even  numbers are: ", sum);

  }

 else

  {

   pro=num1*num2;

    printf("Product of both odd  numbers are: ", pro);

  }

  return 0;

}

Similar questions