Close
Close

why i am not getting asked by computer to enter the id in my c++ programm?

   @shaurya

#include<iostream>
using namespace std;

struct st{
char name[50];
int id;
};

int main(){
struct st s[3];


    cout<<"Student please enter their name: "<<endl;
    cin>>s[1].name;
    cout<<"Enter your id"<<endl;
    cin>>s[1].id;

}

can you please help me to why this line is not working   “ cout<<"Enter your id"<<endl;
    cin>>s[1].id ;     ”


Answers

Ask Yours
Post Yours
Write your answer