0% found this document useful (0 votes)
29 views1 page

C++ Program for Student Introduction

This C++ program prompts the user for their name, section, age, and dream grade, then outputs a formatted message including these details. It uses standard input and output streams to gather and display information. The program serves as a simple introduction to C++ programming concepts.
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
29 views1 page

C++ Program for Student Introduction

This C++ program prompts the user for their name, section, age, and dream grade, then outputs a formatted message including these details. It uses standard input and output streams to gather and display information. The program serves as a simple introduction to C++ programming concepts.
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd

#include <iostream>

#include <string>
using namespace std;

int main() {
string name, section;
int age;
float grade;

cout << "Please enter your name: ";


getline(cin, name);

cout << "Please enter your section: ";


getline(cin, section);

cout << "Please enter your age: ";


cin >> age;

cout << "Please enter your dream grade: ";


cin >> grade;

cout << "############################HEAD#####################\n";


cout << "2 \"\\ Hello World \\\\\\\" \n";
cout << " \"\\ My Name is " << name << " \\\\\\\" \n";
cout << " \"\\ From Grade 10 " << section << " \\\\\\\" \n";
cout << " \"\\ This Is my First C++ Program \\\\\\\" \n";
cout << " \"\\ I am " << age << " years old \\\\\\\" \n";
cout << " \"\\ My dream grade in Computer Science 10 is " << grade <<
"% \\\\\\\" \n";
cout << "####################################################\n";

return 0;
}

You might also like