Question: ok so i am working on a program to only print out the prime numbers from what the user inputs in the keyboard, which is

ok so i am working on a program to only print out the prime numbers from what the user inputs in the keyboard, which is what theNum variable holds. the other int variables declared is x, y, and counter and it has to be done with a nested for loop and I have been failing at this problem. oh and the language is C.
Thank you!  ok so i am working on a program to only print

int thebum trier theCY laua. Drime Numnher Ce Y Lab4 [-/Documents/Lab4] - ../cscd240lab4.c Lindow Help Lab4|Debug copy /- 10; printf( format "Odd(s): d Even(s) d Zero(s): d ", odd, even, zero ); break; case 3: // using nested for loops print the prime numbers counter- 0: // from 2 up to and possibly including theNum // Your code goes below to the break for (x - 2; x theNum; x++) { for (y - 2; y e theNum/2; y++) { if(xty - 0) { counter++; iffcounter- O6 x t- 1) { printf(omat "", x); break default: main theum ssibly including theun n theum possibly including thet Terminal Ovent Log 685 chars, 15 ine breaks 91:31 LF UTF-8 4 spaces CLab4/Debug

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!