#include<iostream.h>
#include<conio.h>
char check (int n);
void main()
{
clrscr();
int arr[5];
char r;
cout<<"Enter five numbers: "<<endl;
for(int i=0; i<5; i++)
cin>>arr[i];
for(i = 0; i<5; i++)
{
r = check(arr[i]);
if(r == 't')
cout<<arr[i]<<" is even. "<<endl;
else
cout<<arr[i]<<" is not even. "<<endl;
}
getch();
}
char check(int n)
{
if(n%2 == 0)
return 't';
else
return 'f';
}
#include<conio.h>
char check (int n);
void main()
{
clrscr();
int arr[5];
char r;
cout<<"Enter five numbers: "<<endl;
for(int i=0; i<5; i++)
cin>>arr[i];
for(i = 0; i<5; i++)
{
r = check(arr[i]);
if(r == 't')
cout<<arr[i]<<" is even. "<<endl;
else
cout<<arr[i]<<" is not even. "<<endl;
}
getch();
}
char check(int n)
{
if(n%2 == 0)
return 't';
else
return 'f';
}
good
ReplyDelete