limit the number of digits in c++

Joined
May 31, 2012
Messages
1
Reaction score
0
i m a new user of c++. m making a simple program but i dont know which data type should i use. i want to limit the users input to 13 digits

#include<iostream.h>
#include<conio.h>
void main()
{
int a;
clrscr();
cout<<"Enter the cnic number:";
cin>>a;
if(a<=1000000000000 && a<10000000000000)
if(a%2==0)
cout<<"Female";
else
cout<<"Male";
else
cout<<"Invalid";
getch();
}

hope you get my point. any help????? do tell my mistakes . thanks
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,992
Messages
2,570,220
Members
46,807
Latest member
ryef

Latest Threads

Top