printf and scanf functions in C | Printf() and Scanf() function | C programming Tutorial online 2020

preview_player
Показать описание
In this video we are going to learn what are printf() and scanf():

These methods are used for input and output in C language.
Both the function printf() and scanf() are the library function.
Both the function are defined in header file stdio.h

printf():
It is used for output. It is used to print the given statements to output console window.
Syntax is as below:
printf(“formatted string”, arguments)

Eg:
Int x,y,z;
x=10;
y=20;
z=x+y;
Printf(“sum of %d and %d is %d”,x,y,z);
Output: sum of 10 and 20 is 30
This function is used to take input.
It reads the input data given by user from the console.
Syntax:
Scanf(“formatted string”, arguments);
Eg: int n;
printf(“enter a number \n”);
scanf(“%d”, &n);
printf(“you have given the number %d”, n);
Output: enter a number
you will enter a number from keyboard – suppose 30
you have given the number 30

subscribe to learn:
Рекомендации по теме
visit shbcf.ru