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.

Why is this program giving error ??

+2 votes
asked Sep 20, 2021 by Sahil Mishra (140 points)
#include <iostream>
using namespace std;

inline int square(int a){
    return a*a;
}
int main(){
    int a;
    cout<<"Enter the value of a"<<end l;
    cin>>a;
    cout<<"The product of a and b is"<<square(a)<<end l;
}

1 Answer

+3 votes
answered Sep 20, 2021 by Peter Minarik (86,180 points)

endl is a single word, not two as "end l".

Also, in your last line, you talk about "a and b", but only one value was entered by the user (a), so you're confusing the user.

Welcome to OnlineGDB Q&A, where you can ask questions related to programming and OnlineGDB IDE and and receive answers from other members of the community.
...