Computer Science, asked by abhiroy22, 9 months ago

Predict output for the following code.
#include <stdio.h>
void main() {
double k = 0;
for (k = 0.0; k < 3.0; k++);
printf("%lf", k);​

Answers

Answered by swati759266
0

Indianapolis8280101i101iwjs91j9i1k292i82i28wi29wi29818uwjd9jd7h228dhd8wn8w1b7d7w92992928737e89xonw9jw9jdz9wn8wh7s2br87777r7ij9id9jdije91je9ej9ej19dwkox

Answered by Rameshjangid
0

Answer:- The output of the given algorithm will be 3.000000

Given code or algorithm is:-

#include <stdio.h>

void main() {

double k = 0;

for (k = 0.0; k < 3.0; k++);

printf("%lf", k);​

The output of this algorithm will be:-

Output:-

3.000000

1. The Printf function is a separate instruction as it is not included within the loop or in the semicolon “;” after the for loop. After the execution of the given loop, the printf statement will execute.

2. All valid C programs should contain the main()function. The code execution will always begin from the start of the main()function.

3. The printf() function is a library function which is used to send formatted output to the screen.

4. To use the printf() function in our program, we need to include stdio.header file  the #by using include <stdio.h>statement.

To know more about the topic please go through the following links

Link1:- https://brainly.in/question/31577847?

Link2:- https://brainly.in/question/31578480?

#SPJ2

Similar questions