以下示例是关于C中包含如何在C语言中获得用户输入用法的示例代码,想了解如何在C语言中获得用户输入的具体用法?如何在C语言中获得用户输入怎么用?如何在C语言中获得用户输入使用的例子?那么可以参考以下相关源代码片段来学习它的具体使用方法。
#include <stdio.h>
//this is for storing numbers
int main(){
int age; //this makes a vairable for you to store the value in
printf("enter in your age: "); //this prints a prompt for the user
scanf("%d", &age); //this takes in the argument given and stores it
//into the address of age
return 0;
}
本文地址:https://www.itbaoku.cn/snippets/785425.html