Wednesday, February 3, 2021

Program To Print student ID & FEE in C++

Program To Print Student ID & FEE



#include<iostream.h>
#include<conio.h>
class stu
{
  private;
  int id;
  char name[220];
  float fee;
  public;
  void getdata();
};
void stu :: getdata();
{
  cout<<"Enter the id, name & fee";
  cin>>id >>name>>fee;
  cout<<"the id is <<id<<endl;
  cout<<"the fee is "<<fee <<endl;
}
void main()
{
  stu s;
  s.getdata();
  getch();
}



Output : 


Enter the id name & fee
23
Ashish
45,000
the id is 23
the name is Ashish 
The fee is 45,000

No comments:

Post a Comment