Click here to Skip to main content
15,117,882 members
Please Sign up or sign in to vote.
1.00/5 (2 votes)
See more:
C++
#include <iostream>

using namespace std;

int main();
    int pradinis = 7;
    int tarpinis = pradinis + pradinis % 50;
    int galutinis = tarpinis / (tarpinis + 30);
{
    cout <<int galutinis<< endl;
    return 0;
}

Im getting error expected unqualified-id before '{' token. and i want program to tell what is int galutinis
Posted
Updated 10-Jul-21 7:46am
v2
Comments
Member 14675004 6-Dec-19 1:49am
   
void f_input();
{
cout << "Enter first number: ";
cin >> f;}
this function has an error
error expected unqualified id before '{' token

1 solution

You really need to go back and look at your book on the structure of a C++ program. You started to make a function, but left out the function header.

C++
#include <iostream>

using namespace std;

int main()
{
    int pradinis = 7;
    int tarpinis = pradinis + pradinis % 50;
    int galutinis = tarpinis / (tarpinis + 30);

    cout << galutinis<< endl;

    return 0;
}
   
v3
Comments
[no name] 29-Dec-15 12:37pm
   
Sir, galutinis have declared twice.Does it gives no error?
Dave Kreskowiak 29-Dec-15 13:20pm
   
Declared twice? No it isn't. It's declared once.
[no name] 29-Dec-15 14:58pm
   
Sir, "int" datatype was seen in the output statement but now it is not.I think I have seen the OP' s question. Sorry sir.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)




CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900