Printf Practice
Example: Using Format Specifiers and Variables in Printing
main.c
123456789101112#include <stdio.h> int main() { int iVariable = 832; float fVariable = 54.984; char cVariable = '#'; printf(" iVariable = %d \n fvariable = %f \n cVariable = %c \n", iVariable, fVariable, cVariable); return 0; }
Uppgift
Swipe to start coding
- Assign the value of
100
to the variable namedintVariable
. - Choose an appropriate data type for the variable
charVariable
. - Utilize the
printf()
function to display the values of both variables in a single call.
Lösning
Var allt tydligt?
Tack för dina kommentarer!
Avsnitt 2. Kapitel 8
single
Fråga AI
Fråga AI
Fråga vad du vill eller prova någon av de föreslagna frågorna för att starta vårt samtal
Awesome!
Completion rate improved to 2.63Awesome!
Completion rate improved to 2.63
Printf Practice
Example: Using Format Specifiers and Variables in Printing
main.c
123456789101112#include <stdio.h> int main() { int iVariable = 832; float fVariable = 54.984; char cVariable = '#'; printf(" iVariable = %d \n fvariable = %f \n cVariable = %c \n", iVariable, fVariable, cVariable); return 0; }
Uppgift
Swipe to start coding
- Assign the value of
100
to the variable namedintVariable
. - Choose an appropriate data type for the variable
charVariable
. - Utilize the
printf()
function to display the values of both variables in a single call.
Lösning
Var allt tydligt?
Tack för dina kommentarer!
Avsnitt 2. Kapitel 8
single
Awesome!
Completion rate improved to 2.63
Printf Practice
Svep för att visa menyn
Example: Using Format Specifiers and Variables in Printing
main.c
123456789101112#include <stdio.h> int main() { int iVariable = 832; float fVariable = 54.984; char cVariable = '#'; printf(" iVariable = %d \n fvariable = %f \n cVariable = %c \n", iVariable, fVariable, cVariable); return 0; }
Uppgift
Swipe to start coding
- Assign the value of
100
to the variable namedintVariable
. - Choose an appropriate data type for the variable
charVariable
. - Utilize the
printf()
function to display the values of both variables in a single call.
Lösning
Var allt tydligt?
Tack för dina kommentarer!