Introduction
In this lab, you will learn how to read user input in C programming language using the scanf()
function. The scanf()
function is used to read input from the user and is defined in the standard input/output library stdio.h
. C language is a strongly typed language and supports different data types. In this example, we will use the char
and int
data types to read and display user input.
Skills Graph
%%%%{init: {'theme':'neutral'}}%%%%
flowchart RL
c(("`C`")) -.-> c/UserInteractionGroup(["`User Interaction`"])
c(("`C`")) -.-> c/BasicsGroup(["`Basics`"])
c(("`C`")) -.-> c/PointersandMemoryGroup(["`Pointers and Memory`"])
c(("`C`")) -.-> c/FunctionsGroup(["`Functions`"])
c/UserInteractionGroup -.-> c/output("`Output`")
c/BasicsGroup -.-> c/data_types("`Data Types`")
c/BasicsGroup -.-> c/operators("`Operators`")
c/UserInteractionGroup -.-> c/user_input("`User Input`")
c/PointersandMemoryGroup -.-> c/memory_address("`Memory Address`")
c/FunctionsGroup -.-> c/function_declaration("`Function Declaration`")
subgraph Lab Skills
c/output -.-> lab-136075{{"`Read User Input`"}}
c/data_types -.-> lab-136075{{"`Read User Input`"}}
c/operators -.-> lab-136075{{"`Read User Input`"}}
c/user_input -.-> lab-136075{{"`Read User Input`"}}
c/memory_address -.-> lab-136075{{"`Read User Input`"}}
c/function_declaration -.-> lab-136075{{"`Read User Input`"}}
end