Having a little trouble figuring this one out, I have a bunch of int variables which are generating random numbers from 1-9. I need them to generate the correct numbers to equal
Well, i hope you realize that in your do while loop, you are not actually changing the values of the random numbers.What you are doing is basically checking the same condition of finalsum = numone + numtwo + numthree + numfour;
infinitely if it does not equal 30.What you should do is:
int numone,numtwo,numthree,numfour,finalsum;
do{
numone=rand()%10;
numtwo=rand()%10;
numthree=rand()%10;
numfour=rand()%10;
finalsum = numone + numtwo + numthree + numfour;
}while(finalsum !=30);