C_26 Unformatted Output Functions in C | C Programming Tutorials

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
in the series of learning programming in c in the previous video i have discussed unformatted input functions in c and we now we are left with unformatted output functions in c what are unformatted input functions get ch get care get chu and get s and unformatted output functions are what put care put ch and put s more functions are also there one is get c unformatted input function and one is put c unformatted output function but those are having some different concepts so both gate c and put c i'll be discussing in a separate video right in this video i'll be talking about unformatted output functions in c all the three functions with examples and how you can use those functions in your program and when you use those functions in your program then what kind of output you will get so everything will be discussing in this video i hope now you are clear with formatted and unformatted input means difference between formatted input and unformatted input if difference between a formatted output and unformatted output i hope you are aware about this thing because we have discussed formatted input output functions and unformatted input output functions output functions will be covering this video right so if you are clear with formatted and unformatted input and output then please let me know in comment box what do you mean by formatted input what do you mean by unformatted input what do you mean by for formatted output what do you mean by unformatted output right and if you have any doubt you can ask me in comment box or maybe i can make a separate video uh to get you clear about the difference between these right and this video is brought to you by an academy for nta ugc net aspirants there are multiple batches going on on an academy and many batches are going to be started for nt ugc net aspirants as you can see here in these batches their best faculties will be covering the entire slavers for both paper 1 and for paper 2 every subject of paper paper two so you can see here the name of the faculty is the subject they are going to teach and the uh date and here you will get complete course structured course and theory classes some extra classes would be there like preparation strategy they will discuss preparation strategies some tips and tricks time management skills for your nta ugc net exam definitely these batches would be helpful to boost your preparation to build your concepts and to crack and take you the senate exam so you can go for their paid subscription you can use the code jkl10 to get 10 discount on your subscription right and one more thing an academy is also going to launch the most gamified and competitive battle for nt ugc net exam here you will get a chance to compete with thousands of learners foreign exam this combat will cover every single subject real time leaderboards would be there for you after every question just to keep you going scoring and rating would be given to you just to help you constantly assess your progress you can identify your weak areas and after every contest video solutions detailed video solutions will be provided to you so that you can you can assess you can assess your progress you can find out your weak areas and you can improve yourself all the details all the enrollment links as well as the referral code i'll put in the description box of this video you can go and check out now let us discuss unformatted output functions we are having put care put ch and one is put s these two are for two print means these are output functions means to give you output they will give output a single character and this will give output complete the complete string the complete line right now how to use this this foot care function see in a program uh suppose i am writing the same program that we have discussed in the previous video and in that program i am also using that get care function and also that you can revise those functions right i'm just declaring a character variable and did basically majorly they act on that character type or string data these are for character and this is for string let us take this example here i am taking one variable that is of character type the name variable is ch i am using printf functions printf means to take output output means i just want to put a message on the screen whenever you will run a message would be printed on the screen that is enter a character like suppose this is your screen output screen so whenever you run enter a character this would be the output first whatever you will print within this quotation mark that would be on the screen as it is right now i'm getting a character input using get care function right i can take a single character that would be stored in ch now i'm going to print the ch value here i'm using printf function to print the value slash n means next line next line that would be printed character is so the output would be character is equal to this is what format specifier or you can say placeholder now at this place the value would be replaced which value it would it will uh check the the after the coma the first argument right and that should be a character so ch in ch we have whatever character you have entered suppose here i have entered j then j would be printed right and get stage is what just to hold your screen means i hope you know the meaning of get ch why i'm saying this because i have discussed my previous video that thing now rather than the sprint f you can use what you can also use this put care function to print single character it will print only single character not more than that so at the place of this printer what you can use put care and what value you are printing you have to pass that variable name here means it will take argument one single argument so the name of that variable is ch or general syntax of foot care would be just here you will write the function name put care and here variable name that is the general syntax so variable name is here ch so rather than this printf if you write here put care ch then also what output you will get obviously here you will not get this output this line character is equal to because only printf can print this this thing that is why we are saying this is what formatted output because we can format our output according to our cell whatever you want right but here if you write this put care then this would not be printed only the character suppose i am entering j so j would be printed here and cursor would be in same line right if you want the cursor should be should move after printing j in the next line then what you can do after writing this put care here what you can do you can write put care slash n slash and this is what escape sequence many escape sequences are there that also will discuss so this is also considered as a character but you have to put this in single quotes slash means new line so cursor would be automatically after printing this j in this new line right so this is one form to write put care function another thing is directly you can write like this put care any character you want to print suppose after slash and i am again writing a function put care and here i am printing k single character so what what output you will get at this time this printf is not there in this program at the time of this ah the place of the sprinter we have these three lines after that we have gate ch and try character suppose i am entering j j after that slash and cursor would be in this line after that put care k so here you will get k in this one and cursor would be here only right if you want to move the cursor in next lines after that you can again write put care slasher right so this is how you can write down here you cannot use any string like multiple character you cannot use that will give error so it is just to print a single character on the screen and it is declared and we defined in what header file sdi dot edge standard input output now next is this put ch function right this is what this is defined in this co new rotation this header file right now functioning of this and this is same this is also used to print to give you output a single character so here rather than this put care if you don't write put care then what you can write you can also write put ch and same you will pass the variable name ch so now if you are writing like this then also same output you will get that is whatever enter character you are entering j that you will get j right and again this also you can also write that slash n here you can also write put ch just to want to print any character suppose i am writing k here so that k would be printed here right these are having same functioning just this is defined in stdr dot h and this is defined in this corner rotate now next is what put s suppose i want to print a complete string output as a complete string here just like that enter a character this is what a string it is not only single character so we cannot use here put care or put ch to print this one yeah we can use put care how in a loop if you write put care in a loop obviously one by one it will you know accept the character still the loop ends right so you can also try that out but without loop if you want to use this put s if you want to print the complete string then you can use what this function put is so now in the same program i'm going to change suppose in at the time of this printf what i am writing simply you can write here put s and whatever you want to print that you can write in double quotes like here you can write enter a character that would be printed here one method is this thing second is what it is going to print a complete string means a character array right so here suppose i am declaring a character array ch having size 10 right or maybe having size 20 enter a character or enter a string here i am writing here enter a string so to get input the string input we use what which unformatted input function get s not get care it is for single character so here i am writing what get s and what argument you will pass here that name ch fine now suppose here i am writing string is what you will print percentage s for string in printf if you are using printf you have to use format specified output percentage s and then ch you will print right so whatever you will enter that string would be printed but suppose if you are not using this printf rather than the sprint what you can use you can write here put s simply name of that character array that is ch that's it at the place of this printf you can write down this thing now here what output you will get enter a string because i am writing this in printf or you can write down in this input s enter a string here you can print anything suppose i am entering what that is jenny's lectures now next get us through this line we are taking the input that that is jenny's lectures right and now what you can do after this i'm printing this using this footage so same what output you will get jenny's lectures one more thing here the new line operator is built in this function means after executing this cursor would not be in the same line as we have discussed input cap cursor would automatically be in second line means no need to give any slash n to moves cursor in next line slash n is already built in in this footage function right so i hope you got the working of these three functions so all the three function what except only one argument here here variable name here also variable name here put s if you write down the general syntax put care variable name put ch variable name put s here you will write string str that is a you know the string you are taking it's you are not taking a single variable name you are not taking a single character you are taking string right in the another video i will be discussing about two functions that is get c and put c this is unformatted input function this is unformatted output function right but they are dealing with those files or you can say that streams so that are having some different concepts and uh one more thing just put what is this has been defined in this stdi rotation put care is also in this and this puts you in in this header file that is conior right so now assignment for you is you have one you have to tell me difference between formatted and unformatted input and output right second is if suppose i write something in a program i write something like this put s a single character that is a what output you will get that you have to tell me a or any character it's up to you right so what output you will get you have to tell me in comment box so i think that's it for this video now i'll see you in the next video till then bye bye take care
Info
Channel: Jenny's lectures CS/IT NET&JRF
Views: 21,846
Rating: undefined out of 5
Keywords: data structure tutorials, operating system, data structure and algorithms, jayanti khatri lamba, jennys lectures, jenny data structures, jennys lectures DS, jenny lamba, jennys baby, jennys lectures baby, data structures
Id: H5YZKl-XzHY
Channel Id: undefined
Length: 13min 33sec (813 seconds)
Published: Sat Jan 09 2021
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.