Wednesday, 12 October 2016

HHW Q4. WAP to check whether a no. is odd or even .

#include<iostream.h>
#include<conio.h>
void main()
{
clrscr();
int a;
cout<<"Enter the no. ";
cin>>a;
if (a%2==0)
{cout<<"No. is even ";
}
else
{cout<<"No. is odd";
}
getch();
}

No comments:

Post a Comment

Basic Implementation of Array as a Pointer

#include<iostream.h> #include<conio.h> void main() { clrscr();   int arr[5];   cout<<"Enter 5 nos. ";   f...