Help me to solve this please

Write c++ program that read your name , your gender as character, three integer marks . Then
the program calculate your average and prints your information.
The output should be as the following as an example:
Please enter your name and your gender Ola F
Please enter your marks 90 80 85
Ola got 85 as an average

Firstly, welcome to the forums.

While we are primarily here to help people with their Free Code Camp progress, we are open to people on other paths, too.

With your current questions, we don’t have enough context to know what you already know or don’t know, so it is impossible to guide you without just telling you the answer (which we won’t do).

It is pretty typical on here for people to share a codepen / / jsfiddle example of what they have tried so that anyone helping has more of an idea of what help is actually helpful.

Please provide some example of what you’ve tried and I’m sure you’ll get more help.

Happy coding :slight_smile:

1 Like
#include <iostream 
using namespace std;
int main ()

	char gender='F';
	cout<<"Please enter your name and your gender";
	cout<<"Please enter your marks";
	cin>> 90,80,85;
	cout<<"Ola got 85 as an average";
return 0;

I’ve edited your post for readability. When you enter a code block into a forum post, please precede it with a separate line of three backticks and follow it with a separate line of three backticks to make it easier to read.

You can also use the “preformatted text” tool in the editor (</>) to add backticks around text.

See this post to find the backtick on your keyboard.
Note: Backticks (`) are not single quotes (’).

Now that you’ve shared your code, can you describe what part you need help with?
How do you expect it to work? What is it doing differently?
What else have you tried? What debugging steps have you taken?

I don’t think this is how cin works.

1 Like