-
Notifications
You must be signed in to change notification settings - Fork 52
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
695f258
commit 2acc616
Showing
1 changed file
with
39 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
#include <iostream> | ||
using namespace std; | ||
|
||
struct student | ||
{ | ||
char name[50]; | ||
int roll; | ||
float marks; | ||
} s[10]; | ||
|
||
int main() | ||
{ | ||
cout << "Enter information of students: " << endl; | ||
|
||
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; | ||
|
||
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; | ||
} |