Hello, OnlineGDB Q&A section lets you put your programming query to fellow community users. Asking a solution for whole assignment is strictly not allowed. You may ask for help where you are stuck. Try to add as much information as possible so that fellow users can know about your problem statement easily.

Trying to answer my first C++ problem but it says something wrong

+1 vote
asked Feb 18 by Kyle (130 points)
std::cout<<"**********************************"<<std::endl;

std::cout<<"* Programming Assignment 1*"<<std::endl;

std::cout<<"*     Computer Programming I*"<<std::endl;

std::cout<<"*           Author: Collin             *"<<std::endl;

std::cout<<"* Due Date: Thursday, Jan. 24*"<<std::endl;

1 Answer

0 votes
answered Feb 18 by Peter Minarik (101,340 points)

What is the error message? Did you select C++ in the top right corner for the language? Your code seems OK to me. This is how the whole program should look (not just a snippet):

#include <iostream>

int main()
{
    std::cout << "**********************************" << std::endl;
    std::cout << "* Programming Assignment 1       *" << std::endl;
    std::cout << "*     Computer Programming I     *" << std::endl;
    std::cout << "*           Author: Collin       *" << std::endl;
    std::cout << "* Due Date: Thursday, Jan. 24    *" << std::endl;
    std::cout << "**********************************" << std::endl;
    return 0;
}
commented Mar 2 by E (530 points)
Fort the text you can use this:

#include <iostream>
#include <print>
using namespace std

int main()
{
    println(“ **********************************”);
    println(“*      Programming Assignment 1       *“);
    println(“*         Computer Programming I         *”);
    println(“*                   Author: Collin                      *”);
    println(“*      Due Date: Thursday, Jan. 24        *”);
    println(“***********************************”);
    return 0;
}

Saves a lot of time unless its habit of using that one then did.
Welcome to OnlineGDB Q&A, where you can ask questions related to programming and OnlineGDB IDE and receive answers from other members of the community.
...