Run Code
|
API
|
Code Wall
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
Store Information in Structure and Display it
//clang 3.8.0 #include <iostream> using namespace std; struct student { char name[50]; int roll; float marks; } s[10]; int main() { cout << "Enter information of students: " << endl; // storing information for(int i = 0; i < 10; ++i) { s[i].roll = i+1; cout << "For roll number" << s[i].roll << "," << endl; cout << "Enter name: "; cin >> s[i].name; cout << "Enter marks: "; cin >> s[i].marks; cout << endl; } cout << "Displaying Information: " << endl; // Displaying information for(int i = 0; i < 10; ++i) { cout << "\nRoll number: " << i+1 << endl; cout << "Name: " << s[i].name << endl; cout << "Marks: " << s[i].marks << endl; } return 0; }
run
|
edit
|
history
|
help
0
std::99 bottles of beer!
Assignment Operator Example
C++ does not have reference-to-reference types
ECE2574_Function_Calling_Example
Test titlu
C++ out of ref
Linux codecvt wide string conversion with multibyte chars and locale + concatenation
Template Meta Programming
template specialization inheritance solution
virtual members