Basic+input+and+output+of+C

=**printf and Scanf**=

In c, we use printf and scanf function to achieve input and output purposes. toc

Printf
code format="c"


 * 1) include 

using namespace std;

int main(int argc, char *argv[]){ int n = 13; printf("%d hello world",%d); return 0; } code result:

Scanf
code format="csharp"
 * 1) include

int main(int argc, char *argv[]){ int x;

scanf("%d",&x);

printf("%d",x); } code

result: x will be printed any number the user typed

here is how you use it: printf("data type",variable); scanf("data type",variable);

note, for scanf function, all the variable except for characters or strings requires '&' in front of it to indicate its location in the memory which will be saved after compiling.
 * = Datatype ||= Code ||
 * = integer ||= %d ||
 * = float ||= %f ||
 * = character ||= %c ||
 * = string ||= %s ||