Illustrate the concept of arrays in classes.
CODE:
CODE:
#include<iostream.h> #include<conio.h> #include<stdio.h> class ece { int marks; int rn; char name[30]; public : void get() { cout<<"Enter roll no. of student"; cin >>rn; cout<<"Enter name of student"; gets(name); cout<<"Enter the marks" ; cin>>marks; } void show() { cout<<"\nname of student "; puts(name); cout<<"\nroll no. of student "; cout<<rn; cout<<"\nmarks of the student "; cout<<marks; } }; void main() { ece obj1; obj1.get(); obj1.show(); getch(); }
For Further Reading,
0 comments:
Post a Comment