Banner Ad

    A    L    W    A    Y    S           D    E    S    I    R    E           T    O           L    E    A    R    N           S    O    M    E    T    H    I    N    G           U    S    E    F    U    L   

Sunday, May 8, 2011

IPE Lab 10A

#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;
}
 

0 comments:

Related Posts Plugin for WordPress, Blogger...

your comments