Show person Information using Structure in C++

Example Program:

Here is the simple program for showing person Information using Structure in C++.

Source Code

using namespace std;
struct Person
  char name[50];
  int age;
  float salary;
int main()
  Person p1;
  cout<<"Enter Full name: ";
  cout<<"Enter age: ";
  cout<<"Enter salary: ";
  cout<<"\nDisplaying Information."<<endl;
  cout<<"Name: "<<<<endl;
  cout<<"Age: "<<p1.age<<endl;
  cout<<"Salary: "<<p1.salary;
  return 0;
To download raw file Click Here


Enter Full name: Ram
Enter age: 20
Enter salary: 20000
Displaying Information.
Name: Ram
Age: 20
Salary: 20000

Basic Programs

Flow Control

IF Statement Examples

Switch Case

Goto Statement

Break and Continue

While Loop

Do While Loop

For Loop

Friend Function in C++

String Examples

Array Examples

Structure Examples

Structure & Pointer Examples

Structure & Functions Examples

Enumeration Examples

Template Examples


Inheritance Examples

Hierarchical Inheritance

Hybrid Inheritance

Multilevel Inheritance

Multiple Inheritance

Single Level Inheritance

Class and Objects

Constructor Example

Destructor Example

Operator Overloading Example

Operator and Function Example

List of Programs

Pointer Examples

Memory Management Examples

Pointers and Arrays

Virtual Function Examples

Learn All in Tamil © Designed & Developed By Tutor Joes