//Programme for cheak 7th number is odd or evan using pointer
#include<iostream>
using namespace std;
int main()
{
cout<<"enter 10 no.\n";
int a[10],b,*p,*q;
p=a;
q=&b;
for(int i=0;i<10;i++)
{
cin>>*(p+i);
}
if(*(p+6)%2==0)
cout<<"7th no. is evan";
else
cout<<"7th no. is odd";
}
#include<iostream>
using namespace std;
int main()
{
cout<<"enter 10 no.\n";
int a[10],b,*p,*q;
p=a;
q=&b;
for(int i=0;i<10;i++)
{
cin>>*(p+i);
}
if(*(p+6)%2==0)
cout<<"7th no. is evan";
else
cout<<"7th no. is odd";
}
No comments:
Post a Comment