Click here to Skip to main content
15,897,273 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-Jun-22 6:20am
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

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;
}
 
Share this answer
 
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.
#include <iostream>
using namespace std;
	int main()
	{
		int a,b;
		cout<<"please enter number A"<<endl;
 cin="">>a;
		cout<<"please enter number B"<<endl;
 cin="">>b;
		cout<<"the subtract is this  "<<endl;
 cout<<a+b;
="" 
="" return="" 0;
="" }
="" char="" a;
="" if(a="='+')
" {
="" cout<<"correct="" operator="" is"<<endl;
="" cin="">>a;
		
		else{
			cout<<" wrong operator is.";
		}</endl;
></endl;
></endl;
></iostream>
 
Share this answer
 
#include<iostream>
#include<conio.h>
using namespace std;

maxResult(float eq1,float eq2,float eq3){


if(eq1>eq2 && eq1>eq3){
cout<< "Equation 1:"<<" "<<eq1<<" "<<"="" result="" is="" maximum\n"<<endl;
=""
="" }
="" else="" if(eq2="">eq1 && eq2>eq3){
cout<<"Equation 2:"<<" "<<eq2<<" "<<"result="" is="" maximum\n"<<endl;
=""
="" }
="" else="" if(eq3="">eq1 && eq3>eq2){

cout<<"Equation 3:"<<" "<<eq3<<" "<<"result="" is="" maximum\n"<<endl;
="" }
}
=""
="" else





calculateequationresult()
{
="" float="" eq1;
="" eq2;
="" eq3;
="" a;
="" b;
="" c;
="" d;
="" x;
="" int="" count="0
" while(count<2){
="" a="6;
" b="7;
" c="8;
" d="9;
" x="11;
" }
="" else{
="" eq1="x+(b/(3*a))
" eq2="(3*a*c-b*b)/(3*a*a);
" eq3="(2*b*b*b-9*(a+b+c)+(27+a*a*a);
cout<<"Equation" 1:"<<""<<eq1<<endl;
cout<<"equation="" 2:"<<""<<eq2<<endl;
cout<<"equation="" 3:"<<""<<eq3<<endl;

maxresult(eq1,eq2,eq3)
}

int="" main()
{="" char="" choice;

bool="" run="true;


while(run)
{
" do{
="" calculateequationresult();
="" cout<<"would="" you="" like="" to="" perform="" other="" calculation?(y="" n)";
="" cin="">>choice;
choice=tolower(choice);
}
while(choice!='n' && choice!='y');

if(choice=='n'){
run=false;


}
}
result 0;
}

}
 
Share this answer
 

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