Question : input in c
Answered by : stormy-shark-i1lvt8qnhxk9
Integer: scanf("%d", &intVariable); printf("%d", intVariable);
Float: scanf("%f", &floatVariable); printf("%f", floatVariable);
Character: scanf("%c", &charVariable); printf("%c", charVariable);
Word: scanf("%s", &strVariable) printf("%s" , strVariable)
Sentence: scanf(" %[^\n]s", &strVariable); // in same line scanf("%[^\n]s", &strVariable); // with new line printf("%s", strVariable)
Source : | Last Update : Mon, 25 Jul 22
Question : Syntax To Take Input In C
Answered by : amused-aardvark-pancsqce4yqx
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);
Source : | Last Update : Wed, 19 Aug 20
Question : how to take input in C
Answered by : golden-horde
scanf("%d", &var);
Source : https://www.programiz.com/c-programming/c-pointers | Last Update : Thu, 26 May 22