The world’s Largest Sharp Brain Virtual Experts Marketplace Just a click Away
Levels Tought:
Elementary,Middle School,High School,College,University,PHD
| Teaching Since: | May 2017 |
| Last Sign in: | 398 Weeks Ago, 6 Days Ago |
| Questions Answered: | 66690 |
| Tutorials Posted: | 66688 |
MCS,PHD
Argosy University/ Phoniex University/
Nov-2005 - Oct-2011
Professor
Phoniex University
Oct-2001 - Nov-2016
Create a counting program that prompts the user for 3 inputs (shown next) that determine how and what to count. Store the user's answers in veriables. Use the acquired data to build your counting program with a for loop and display the results to the user.
1)Beginning number to start counting from
2) Ending number to stop counting at
3) Increment number
**This is what I have but it keeps kicking me out after I input the values.
#include
#include
main()
{
//Call variables
int iBegin=0;
int iEnd=0;
int iIncrement=0;
int x=0;
int y=1;
//Assign variables
printf("\nPlease input a number to begin counting: \n");
scanf("%d", &iBegin);
printf("Please input a number to stop counting: \n");
scanf("%d", &iEnd);
printf("Please input the amount you want to count by: \n");
scanf("%d", iIncrement);
//for loop
for ( x = iBegin; x < iEnd; x=y++ * iIncrement )
  printf("%d", x);
}


Hel-----------lo -----------Sir-----------/Ma-----------dam-----------Tha-----------nk -----------You----------- fo-----------r u-----------sin-----------g o-----------ur -----------web-----------sit-----------e a-----------nd -----------and----------- ac-----------qui-----------sit-----------ion----------- of----------- my----------- po-----------ste-----------d s-----------olu-----------tio-----------n.P-----------lea-----------se -----------pin-----------g m-----------e o-----------n c-----------hat----------- I -----------am -----------onl-----------ine----------- or----------- in-----------box----------- me----------- a -----------mes-----------sag-----------e I----------- wi-----------ll