Whats wrong with the code?
using namespace std; #include <iostream> #include <string> #include <cstdio> class classroom{ public: int roll_no; string gender; string name; string studentgender; if (gender == 'male'){ studentgender = 'he'; } else if (gender == 'female'){ studentgender = 'she' } void getinfo(int roll, string n){ roll_no = roll; name = n; } void showinfo(){ printf("the name of the student is %s and %s roll no is %i", name, studentgender roll_no); } }; int main() { classroom student1; student1.name = "sai"; student1.roll_no = 20; student1.showinfo(); } this code is written in c++ and I used printf instead of cout. even printf function works in some situations.But anyways can anyone tell me the correct code