Friday, 28 October 2016

Write a program in c++ to read and write in structure.

Coding:- 
               
#include<iostream.h>


struct ank
{
long int sal;
long int age;

}  var ;

main()
{

cout<<" enter salary of ank =";
  cin>>var.sal;
cout<<"what is the age of ank =";
  cin>>var.age;

  cout<<" salary of ank = "<<var.sal;

  cout<<"\nage of ank ="<<var.age;


}

Output:-




            

No comments:

Post a Comment