0
why this program is not working proper?
#include<iostream> using namespace std; int student () { int a,r; char c; cout<<"Enter the name of student= "; cin>>c; cout<<"Enter the roll number of the student = "; cin>> r; cout<<"Enter the Age of student = "; cin>>a; } int main() { student(); return 0; }
2 Answers
0
make it string c instead char c.
Name is a string , not a char.
Also make your function' s return type as void .
0
And
you are not outputting any values...
Display after taking values..
Like cout<<c;
And add return statement to start function or make it void...