Recent

Comments

Follow us on Facebook

Sunday 31 December 2017

Define a structure student and take values of the members in main and pass the structure to the function as an agrument to display the values


Image result for c++ structure

 pass the structure to the function as an agrument to display the values

#include <iostream>
using namespace std;
struct student
{


char name [30];
string  field;
string  semester;
int rollno;
};
void dispalydata(student);
main()
{
student s;

cout<<"enter your Good name ";
cin.get(s.name,100);
cout<<"which is your field  ";
    cin>>s.field;
cout<<"enter your roll no  ";
cin>>s.rollno;

cout<<"In which semeter you study  ";
cin>>s.semester;

dispalydata(s);
return 0;

}
void dispalydata(student s)
{
cout<<"\nfollowing is your information   ";
cout<<"\nNAME"<<"    "<<s.name<<endl;
cout<<"ROLL NO"<<"    "<<s.rollno<<endl;
cout<<"FEILD"<<"   "<<s.field<<endl;
cout<<"semester"<<"    "<<s.semester<<endl;

}

0 on: "Define a structure student and take values of the members in main and pass the structure to the function as an agrument to display the values"

Write a program, that takes 16-Elements in Two-Dimensional-Array that has 4 rows & 4 columns, then display the diagonal of Matrix.

Write a program, that takes 16-Elements in Two-Dimensional-Array that has 4 rows & 4 columns, then display the diagonal of Matrix. ...

propeller ads

PropellerAds