C Variables
Declare typed values.
C
#include <stdio.h>
int main(void) {
int score = 91;
printf("%d\n", score);
return 0;
}Output
91
Explanation
C variables have explicit types. int stores an integer, while double stores a floating point value. printf writes formatted output.
Explore the dry run
Guided walkthroughReady
1
#include <stdio.h>2
int main(void) {3
int score = 91;4
printf("%d\n", score);5
return 0;6
}Follow the example
Start to inspect the source, values, and output. These prepared steps explain the published sample; grouped loop steps describe multiple iterations.
View the complete dry-run table
| Step / line | What happens | State after step | Output so far |
|---|---|---|---|
| Allocate an int named score and initialize it to 91. | score = 91 | — | |
| %d formats the integer; \n ends the line. | score = 91 | 91 | |
| Return zero to signal successful completion. | score = 91 | 91 |