The Code is some errors please find the error and typed the code without errors and take a screenshort attach the answer
Posted: Fri Jul 08, 2022 6:36 am
The Code is some errors please find the error and typedthe code without errors and take a screenshort attach theanswer
#include using namespace std; int main() //variabless int number; int numberOfNumbers float runningTotal=0.0, average; int choice; // loop to an enter the numbers do { = } 0; cout << "1. Enter Numbers. \n"; cout << "2. Print Average at the End.\n"; cout << "Enter the choice:=\n"; cin >> choice; if (choice==1) { cout << "Enter the number:=\n"; cin >> number; number of Numbers = numberOfNumbers + 1; runningTotal = runningTotal + number;
return 0; }#include using namespace std; int main() { //variabless int number; int numberOfNumbers = 0; float runningTotal=0.0, average; int choice; // loop to an enter the numbers do { cout << "1. Enter Numbers. \n"; cout << "2. Print Average at the End. \n"; cout << "Enter the choice:=\n"; cin >> choice; if (choice =1) { cout << "Enter the number:=\n"; cin >> number; numberOfNumbers = numberOfNumbers + 1; runningTotal = runningTotal + number;
1 #include 2 using namespace std; 3 4 int main() 5 - { 6 7 8 9 10 11 12 13 - 14 15 16 17 18 19 - 20 21 22 23 24 //variabless int number; int numberOfNumbers = 0; float running Total=0.0, average; int choice; // loop to an enter the numbers do { cout << "1. Enter Numbers. \n"; cout << "2. Print Average at the End. \n"; cout<<"Enter the choice:=\n"; cin >> choice; if (choice =1) { } cout << "Enter the number :=\n"; cin >> number; numberOfNumbers = numberOfNumbers + 1; runningTotal = runningTotal + number; g++ /tmp/xQpVXSY5EM.cpp /tmp/xQpVXsY5EM.cpp:34:2: error: stray '#' in program 34 #include |^ /tmp/xQpVXSY5EM.cpp:67:2: error: stray '#' in program 67 #include |^ /tmp/xQpVXSY5EM.cpp:34:3: error: 'include' does not name a type 34 #include I /tmp/xQpVXsY5EM.cpp:37:5: error: redefinition of 'int main()' 37 | int main() | ^~~~ /tmp/xQpVXsY5EM.cpp:4:5: note: 'int main()' previously defined here 4 int main() I ^~~~ /tmp/xQpVXsY5EM.cpp:67:3: error: 'include' does not name a type 67 #include I /tmp/xQpVXSY5EM.cpp:70:5: error: redefinition of 'int main()' 70 int main() I /tmp/xQpVXSY5EM.cpp: 4:5: note: 'int main()' previously defined here 4 int main()
#include using namespace std; int main() //variabless int number; int numberOfNumbers float runningTotal=0.0, average; int choice; // loop to an enter the numbers do { = } 0; cout << "1. Enter Numbers. \n"; cout << "2. Print Average at the End.\n"; cout << "Enter the choice:=\n"; cin >> choice; if (choice==1) { cout << "Enter the number:=\n"; cin >> number; number of Numbers = numberOfNumbers + 1; runningTotal = runningTotal + number;
return 0; }#include using namespace std; int main() { //variabless int number; int numberOfNumbers = 0; float runningTotal=0.0, average; int choice; // loop to an enter the numbers do { cout << "1. Enter Numbers. \n"; cout << "2. Print Average at the End. \n"; cout << "Enter the choice:=\n"; cin >> choice; if (choice =1) { cout << "Enter the number:=\n"; cin >> number; numberOfNumbers = numberOfNumbers + 1; runningTotal = runningTotal + number;
1 #include 2 using namespace std; 3 4 int main() 5 - { 6 7 8 9 10 11 12 13 - 14 15 16 17 18 19 - 20 21 22 23 24 //variabless int number; int numberOfNumbers = 0; float running Total=0.0, average; int choice; // loop to an enter the numbers do { cout << "1. Enter Numbers. \n"; cout << "2. Print Average at the End. \n"; cout<<"Enter the choice:=\n"; cin >> choice; if (choice =1) { } cout << "Enter the number :=\n"; cin >> number; numberOfNumbers = numberOfNumbers + 1; runningTotal = runningTotal + number; g++ /tmp/xQpVXSY5EM.cpp /tmp/xQpVXsY5EM.cpp:34:2: error: stray '#' in program 34 #include |^ /tmp/xQpVXSY5EM.cpp:67:2: error: stray '#' in program 67 #include |^ /tmp/xQpVXSY5EM.cpp:34:3: error: 'include' does not name a type 34 #include I /tmp/xQpVXsY5EM.cpp:37:5: error: redefinition of 'int main()' 37 | int main() | ^~~~ /tmp/xQpVXsY5EM.cpp:4:5: note: 'int main()' previously defined here 4 int main() I ^~~~ /tmp/xQpVXsY5EM.cpp:67:3: error: 'include' does not name a type 67 #include I /tmp/xQpVXSY5EM.cpp:70:5: error: redefinition of 'int main()' 70 int main() I /tmp/xQpVXSY5EM.cpp: 4:5: note: 'int main()' previously defined here 4 int main()