#include <iostream>
#include <cstring>
#include <cstdlib>
using namespace std;
int main(int argc, char* argv[])
{
char name[20];
int age;
double salery;
if(argc!=4)
cout << "Please type your name, age & salery..." << endl;
else
{
strcpy(name,argv[1]);
age = atoi(argv[2]);
salery = atof(argv[3]);
cout << "Name : " << name << endl
<< "Age : " << age << "y." <<endl
<< "salery : " << salery << "Rs." <<endl;
}
return 0;
}
#include <cstring>
#include <cstdlib>
using namespace std;
int main(int argc, char* argv[])
{
char name[20];
int age;
double salery;
if(argc!=4)
cout << "Please type your name, age & salery..." << endl;
else
{
strcpy(name,argv[1]);
age = atoi(argv[2]);
salery = atof(argv[3]);
cout << "Name : " << name << endl
<< "Age : " << age << "y." <<endl
<< "salery : " << salery << "Rs." <<endl;
}
return 0;
}
0 comments:
Post a Comment