Question Andrew Titov in lesson «Variables and loops in C», course «Intro to C programming language»
Execution is counted, but the test gives a message.
// BEGIN (write your solution here)
int main(void) {
int lower, upper, step, celsium, kelvin;
lower = 0;
upper = 300;
step = 20;
celsium = lower;
while(celsium <= upper) {
kelvin = celsium + 273;
printf("%d : %d\n", celsium, kelvin);
celsium = celsium + step;
}
return 0;
}
// END
make: Entering directory `/usr/src/app'
rm -f solution
gcc -g -Wall solution.c -o solution
solution.c: In function ‘main’:
solution.c:13:9: warning: implicit declaration of function ‘printf’ [-Wimplicit-function-declaration]
printf("%d : %d\n", celsium, kelvin);
^
solution.c:13:9: warning: incompatible implicit declaration of built-in function ‘printf’ [enabled by default]
make: Leaving directory `/usr/src/app'
2
0
Use Hexlet to the fullest extent!
- Ask questions about the lesson
- Test your knowledge in quizzes
- Practice in your browser
- Track your progress
Sign up or sign in
Suggested learning programs

Profession
beginner
Development of front-end components for web applications
start anytime
10 months

Profession
Under development
beginner
Layout with the latest CSS standards
start anytime
5 months