WAP TO READ VALUES IN STRUCTURE ( EG. STUDENT NAME,STUDENT ROLL NO. )



#include<>iostream.h
#include<conio.h>
#include<stdio.h>
struct student
{
     char name[25];
     int rollno;
};
void main()
{
      struct student s;
      clrscr();
      cout<<”Enter the student name:”;
      gets(s.name);
      cout<<”Enter the student roll no.:”;
      cin>>s.rollno;
      cout<<”Student name is:”<<s.name;
      cout<<”Student roll no. is:”<<s.rollno;
      getch();

}

Comments

Popular Posts