Where is the declaration syntax error in the below C++ program?

consist of
utilizing namespace an std;
int main()

float number1, number2,
quantity, average;
cout<< "enter a couple numbers";
cin>>number1;
cin>>number2;
sum=number1+number2;
average=sum/2;
cout<<"sum="<<sum<<"\n";
cout<<"average="<<average<<"\n";
gain 0;

\\error is definitely shown within the line cpp2…

Nirmal
/*
My business is afraid my mate it seems you will be using the stone era compiler.It seems it’s a 16 little compiler published in 1994.My business is not certain if “namespace” keyword and key phrase was section of C++ after that.Do yourself a favor and acquire a more sophisticated C++ IDE.

But don’t worry, just check if the pursuing works.Basically I recently commented released the tier containing namespace keyword as part of your original signal.
*/

/////// ALTERNATIVE FOR Turbo C++ SOME.5

// Our compiler will not know namespaces thus use aged style headers
#include

// utilizing namespace an std; // cannot use std as it’s not necessarily defined around old headers

int main()

float number1, number2, quantity, average;
cout<< "enter a couple numbers";
cin>>number1;
cin>>number2;
sum=number1+number2;
average=sum/2;
cout<<"sum="<<sum<<"\n";
cout<<"average="<<average<<"\n";
gain 0;

// Finish of Software for Turbo C++ FIVE.5

/////// ALTERNATIVE FOR Latest Compilers.Is effective on VC++ A FEW onwards

#include

utilizing namespace an std;

int main()

float number1, number2, quantity, average;
cout<< "enter a couple numbers";
cin>>number1;
cin>>number2;
sum=number1+number2;
average=sum/2;
cout<<"sum="<<sum<<"\n";
cout<<"average="<<average<<"\n";
gain 0;

You could see the line two “sum, typical; ” They don’t have your identifier.
sum and also average need to be declared as drift.
Upgrade line

quantity, average;
with

float sum, typical;

or else you might put payment, average within the same range as drift number1, number2

float number1, number2, quantity, average;

Gives thanks, Hope this particular helps

1)The problem is within the tier 6.
quantity and typical donot have data styles.
explain it seeing that float amount, average;

2)It must be #include.

Leave a Reply