i am trying to debug the program yet i cannot. Is there a syntax error im not seeing? In c++ pls #include #in

Business, Finance, Economics, Accounting, Operations Management, Computer Science, Electrical Engineering, Mechanical Engineering, Civil Engineering, Chemical Engineering, Algebra, Precalculus, Statistics and Probabilty, Advanced Math, Physics, Chemistry, Biology, Nursing, Psychology, Certifications, Tests, Prep, and more.
Post Reply
answerhappygod
Site Admin
Posts: 899603
Joined: Mon Aug 02, 2021 8:13 am

i am trying to debug the program yet i cannot. Is there a syntax error im not seeing? In c++ pls #include #in

Post by answerhappygod »

i am trying to debug the program yet i cannot. Is there asyntax error im not seeing? In c++ pls
#include <iostream>#include <ctime>#include <cstdlib>
using namespace std;
void coinToss(int &heads, int &tails){ int randNum = rand() % 2; if (randNum == 1) { heads++; } else { tails++; }}int main(){ int heads = 0, tails = 0, flips, i; srand(time(0)); cout << " How many flips? "; cin >> flips; for (i = 1, i <= flips; i++;){ coinToss(heads, tails); flips++; } return 0;}
Join a community of subject matter experts. Register for FREE to view solutions, replies, and use search function. Request answer by replying!
Post Reply