#include <iostream>
using namespace std
int main();
int test1;
int test2;
int test3;
float av;
test1=1;
test2=2;
ave=(test+test2+test3)/2;
cout<<”The average is <<ave;
return 0;
/*
#include <iostream>
using namespace std //Error -1: the statement should be ended with semi-clon (;)
int main(); //Error -2 main function should not be ended with semi-colon
int test1; // Error-3: main function should start and end with pair of curly brackets {}
int test2;
int test3;
float av;
test1=1;
test2=2;
ave=(test+test2+test3)/2; //Error-4: ave is not defined. Rather it is defined as av
//Error-5: test is not defined. Rather it is defined as test1
cout<<”The average is <<ave; //Error-6: ave is not defined. Rather it is defined as av
//Error-7: The double quote (") should be in pair.
return 0;
*/
#include <iostream>
using namespace std;
int main()
{
int test1; // Error-2: main function should start and end with pair of curly brackets {}
int test2;
int test3;
float av;
test1=1;
test2=2;
av=(test1+test2+test3)/2;
cout<<"The average is "<<av;
return 0;
}
Comments
Leave a comment