“Wejście użytkownika c” Kod odpowiedzi

Jak uzyskać dane wejściowe użytkownika w 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;
}
TheRubberDucky

Składnia do przyjęcia danych wejściowych w C

Integer: Input: scanf("%d", &intVariable); Output: printf("%d", intVariable);
Float: Input: scanf("%f", &floatVariable); Output: printf("%f", floatVariable);
Character: Input: scanf("%c", &charVariable); Output: printf("%c", charVariable);
Amused Aardvark

Jak wziąć wkład w C

scanf("%d", &var);
Golden Horde

Odpowiedzi podobne do “Wejście użytkownika c”

Pytania podobne do “Wejście użytkownika c”

Więcej pokrewnych odpowiedzi na “Wejście użytkownika c” w C++

Przeglądaj popularne odpowiedzi na kod według języka

Przeglądaj inne języki kodu