adsense

Hii, welcome to my site. My name is Om prakash kartik. This blog helps you to learn programming languages concepts.

Program in C++ and C to call function through if statement.

Program in C++ and C to call function through if statement.


C
CPP
#include<stdio.h>
  int isEven()
   {
     int n;
     printf("Enter a number :-");
     scanf("%d",&n);
     return n;
   }
  int main()
   {
    if(isEven()%2==0)
      printf("Even number.");
    else
      printf("Odd number.");
      return 0;
   }
#include<iostream>
 using namespace std;
  int isEven()
   {
     int n;
     cout<<"Enter a number :-";
     cin>>n;
     return n;
   }
  int main()
   {
    if(isEven()%2==0)
      cout<<"Even number.";
    else
      cout<<"Odd number.";
    return 0;
   }
Output:-






Post a Comment

0 Comments