Computer Science, asked by lucasfuller, 6 months ago

What is the answer to 4.3 Code Practice: Question 2 for edhesive

Answers

Answered by mad210203
0

Program is given below.

Explanation:

#include <stdio.h>

int main()

{

//Declaring the variable

 int i;

//Initializing the variable

 i = 3;

 printf("Multiples of 3 are: \n");

//The while loop is used to print the multiples

 while(i<=21)

 {

//Here, if condition is used to check whether i is multiple of 3 or not.

//If it is multiple, the if loop statements executes or else it will not execute.

   if(i%3==0)

   {

     printf("%d \n",i);

   }

//Incrementing the value of i

   i=i+1;

 }

 return 0;

}

Refer the attached image for the output.

Attachments:
Similar questions