Write a while loop that prints to the screen: ONLY the multiples of 3 which are between 4 and 40.
In C code please.
C code:
#include <stdio.h>
int main()
{
//initializing i as 4
int i=4;
//looping till i is 40
while(i<=40){
//checking if i is a multiple of 3
if(i%3==0)
//printing i
printf("%d\n",i);
//incrementing i
i++;
}
return 0;
}
Screenshot:
Input and Output:
Get Answers For Free
Most questions answered within 1 hours.