Originally Posted by
jocdrew21
This question wanted me to count 1-99 backwards and print "found one" when the number was divisible by 5. This is what I got so far.
Code:
#include <stdio.h>
int main(int argc, const char * argv[])
{
int i;
for (i = 99; i > 0; i--)//This will count from 99 decrementally till it reaches 1
{
printf("%d\n",i);
if ((i%5)== 0)
{
printf("found one\n"); //every number this is divisible by 5 write found one
}
}
return 0;
}
Good luck with your C++ programing which school btw