Skip to player
Skip to main content
Skip to footer
Search
Connect
Watch fullscreen
Like
Comments
Bookmark
Share
Add to Playlist
Report
Learn Programming Technique C to Master Skills - Use of getchar and putchar functions program
Tutorials Arena
Follow
10/12/2024
Category
š
Learning
Transcript
Display full video transcript
00:00
Hello everyone. Today I'm going to explain get care and the put care methods or you can
00:10
say the get care and put care functions. We have used in our program the scanf and the
00:18
printf function and we know that the scanf function is to read the value from the keyboard,
00:26
to read the data from the keyboard and the printf function is used to display the data
00:32
on the screen, to display the values on the screen. In the same way the get care and the
00:38
put care function works, if we have to read the characters, so reading a character that
00:45
can be done with the help of the get care. We can use scanf also but if we have to only
00:54
read a single character then in spite of using scanf we can use the get care and if we have
01:00
to write the character on the screen or you have to display the character on the screen
01:05
then there is what put care method or you can say the put care function. So writing
01:10
a character on the screen that can be done by the using of put care. So I'm going to
01:16
explain the programs of it, first of all I'm going to explain the program of get care and
01:23
then I'm going to explain the program of put care. Let me open the program, that of get care.
01:35
So this is the program of get care and it's a very simple program and the program is to
01:49
input the value from the keyboard and on the basis of value it's going to display a message.
01:58
So here if you see I have taken one of the variable a, inside the printf I have written
02:04
a statement that is a message that is to input y for yes and n for no. Now when I input a
02:13
single character that character will be read by the function get care and this function
02:20
is going to store the character value inside the variable a. If I input a character value
02:31
y in uppercase or in a lowercase either in a capital letter or in a small letter then
02:43
the statement is going to satisfy. If the value of a is capital Y or if the value of
02:50
a is small y so it's going to compare with the constants y. So if suppose I have input
02:59
inside a a capital Y so capital Y equal equal to capital Y here the condition is true or if
03:07
suppose I store the value of a small y then small y equal equal to small y here the condition is
03:14
true. So if any one of the condition gets true the statement is going to display, this message
03:20
is going to display and if I input any other alphabet suppose I input n for no either in
03:33
small or a capital that value is going to store inside a. So this both the condition get false
03:38
so it will come to the else part and it's going to display what to buy. So let me run the program
03:45
and see is it going to work or not. First of all let us compile and see if there is any error.
03:51
So it's not showing any error. If for this console window if it's not display so what you can do
04:07
you can go to the view and here it shows what logs or you can press the F2 key so it's going
04:13
to show you the console window. So it's showing what zero error zero warning. So there is no
04:20
error in the program. Let me run the program. Now it's asking me to input the value when I
04:25
press Y and press enter it's showing me welcome. One of the condition is fulfilled and if I again
04:34
run the program and suppose if I input n in a capital letter and I press enter key so this
04:43
condition gets false the statement ends display y. So this is the program of get care and with
04:54
the help of get care function the operation is performed and we get the result. Now I'm
05:03
going to explain the program of put care. This is the program of it. The program is very simple
05:19
that I have to input one of the alphabet from the keyboard and if the alphabet which I input
05:26
the character which I input that is in small letters then it's going to display in a capital
05:32
letter and if it's in a capital letter then it's going to display in a small letters. So I have
05:40
taken out the variable a one message is going to display to enter any alphabet. So with the help
05:46
of get care function I am going to put the value a single character from the keyboard that is going
05:53
to store inside a. Here is one of the predefined function is lower okay that will convert if the
06:04
value it will take the value if it is lower then it's going to convert to upper and it's going to
06:17
display and if the values is not lower so it's going to come to the else part and with the help
06:24
of to lower it's going to convert into lower okay that is in small letters. So if the condition is
06:33
true that is the if the alphabet which you have input that is in is lower that is in small letter
06:41
that alphabet then with the help of to upper it's going to convert into capital letter okay and going
06:48
to display on the screen with the help of put care function and suppose if you have input the alphabet
06:54
in a capital letter so this condition will get false and it will come to the else part and with
06:59
the help of put care function it's going to convert into small letter and going to display. So will
07:07
this happen or not let us see I'm going to run the program. I'm going to store I'm going to input
07:15
the value in a capital letter a and I press enter it should mean a small letter okay the a in a
07:23
lowercase and if I again run the program and this time I input the alphabet in a small letter and
07:34
I press the enter key it's converted into capital letter that is in uppercase okay.
07:40
So I hope you understand how to use the get care and the put care function. Thank you.
Recommended
10:48
|
Up next
Learn Programming Technique C to Master Skills - Structure and Functions Program
Tutorials Arena
11/10/2024
4:44
Learn Programming Technique C to MasterĀ Skills - Use of void with Function
Tutorials Arena
11/6/2024
6:04
Learn Programming Technique C to Master Skills - Structure and Functions
Tutorials Arena
11/10/2024
8:08
Learn Programming Technique C to MasterĀ Skills - First Program of Function
Tutorials Arena
11/3/2024
10:48
Learn Programming Technique C to MasterĀ Skills - Eighth Program of Function
Tutorials Arena
11/3/2024
11:15
Learn Programming Technique C to MasterĀ Skills - Third Program of Function
Tutorials Arena
11/6/2024
7:38
Learn Programming Technique C to Master Skills - Recursive Function - I
Tutorials Arena
11/6/2024
8:45
Learn Programming Technique C to MasterĀ Skills - Ninth Program of Function
Tutorials Arena
11/3/2024
11:19
Learn Programming Technique C to MasterĀ Skills - What is Function
Tutorials Arena
11/6/2024
2:44
Learn Programming Technique C to Master Skills - Switch Case Program ( Use of Character Value)
Tutorials Arena
10/19/2024
7:30
Learn Programming Technique C to MasterĀ Skills - Fifth Program of Function
Tutorials Arena
11/3/2024
7:22
Learn Programming Technique C to MasterĀ Skills - Tenth Program of Function (Use of Different Datatypes)
Tutorials Arena
11/6/2024
4:51
Learn Programming Technique C to MasterĀ Skills - Seventh Program of Function - I
Tutorials Arena
11/3/2024
7:35
Learn Programming Technique C to MasterĀ Skills - Fourth Program of Function
Tutorials Arena
11/3/2024
10:23
Learn Programming Technique C to Master Skills - About Main function and other syntax
Tutorials Arena
9/29/2024
5:27
Learn Programming Technique C to MasterĀ Skills - Sixth Program of Function
Tutorials Arena
11/6/2024
4:22
Learn Programming Technique C to Master Skills - Pointer And Arrays Program
Tutorials Arena
11/9/2024
2:02
Learn Programming Technique C to Master Skills - Use of & sign with variables
Tutorials Arena
9/29/2024
12:06
Learn Programming Technique C to Master Skills - Continuous If Statement Program
Tutorials Arena
10/8/2024
7:56
Learn Programming Technique C to Master Skills - Nested If Statement Program
Tutorials Arena
10/12/2024
7:47
Learn Programming Technique C to Master Skills - Linked List Program by use of Recursive function
Tutorials Arena
12/2/2024
3:27
Learn Programming Technique C to Master Skills - Linked List Program - Use of Recursive function
Tutorials Arena
12/2/2024
10:56
Learn Programming Technique C to Master Skills - Loop With If Statement Program
Tutorials Arena
10/13/2024
3:22
Learn Programming Technique C to Master Skills - Use of Type Specifiers in C Language
Tutorials Arena
9/29/2024
13:34
Learn Programming Technique C to Master Skills - File Handling Program
Tutorials Arena
11/18/2024