Ask Question
31 July, 13:15

7. Write a program to display the output as follows:

Lets learn together C+ + program

It is not so difficult

I

+4
Answers (1)
  1. 31 July, 13:54
    0
    Output

    Enter information of students:

    For roll number1,

    Enter name: Tom

    Enter marks: 98

    For roll number2,

    Enter name: Jerry

    Enter marks: 89

    .

    .

    .

    Displaying Information:

    Roll number: 1

    Name: Tom

    Marks: 98

    .

    .

    .

    Explanation:

    e user and displays it on the screen.

    Example: Store Information in Structure and Display it

    #include

    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;

    }
Know the Answer?
Not Sure About the Answer?
Get an answer to your question ✅ “7. Write a program to display the output as follows: Lets learn together C+ + program It is not so difficult I ...” in 📙 Computers & Technology if there is no answer or all answers are wrong, use a search bar and try to find the answer among similar questions.
Search for Other Answers