Wednesday Educational Theme || Basic C Language Course ||Lecture # 02 || Basic Terminologies & How To Write Your First Code || 20% To @steemit-pak

in hive-136998 •  3 years ago 

Hello Everyone
I hope that you all are doing great.
Welcome back to the second lecture of Basic C Language Course.
Today we will doing to learn some new terminologies we use while coding in C language so without wasting any further let me start my lecture.

image.png

The very first thing we will going to learn is named as Library
So what is library?
As we all know that library is a place where all the books are kept so whenever we need some information we just go and grab a book similarly in programming Library is a place where all the information about different keywords are stored. So whenever we use some kind of keyword Library helps in finding that what is the function of that keyword or in other words what function users wants from me.
For Example
Their is a Library named as STDIO.H in this library the function of printf is stored that what will going to happen if user types printf somewhere while writing the program or code.
Besides this their is an other keyword scanf the function of scanf is also stored in the same library and because of this library the IDE knows that what i have to do when user writes scanf somewhere.
I hope that the main use of library is clear to all of you.
What is this printf and scanf will do we will see when we will going to write our program.
Now we will going to open the IDE we installed

  1. Double Click on the Icon of IDE. This screen will appear.
    image.png

  2. Now press Ctrl + N. You will now able to see a cursor on the screen and you can write your code now.

image.png

  1. Now we will going to write our very first line of code which is: #include<stdio.h>. This is how you insert a library in your program.

image.png

  1. After that you will press enter and then you will going to write main(). This means that your program will going to start from here. After that you will again press Enter and insert a pair of curly brackets { }. Press Enter after inserting the brackets.

image.png
NOTE: Remember one thing all the code you will going to write between this pair of curly brackets otherwise your it is not possible for the IDE to identify because when you write main() now your IDE know that all it has to do is just go inside the main() and perform what user has asked.

  1. Now we will going to write our very first line. Above i told you about the keyword printf so the function of this keyword is simple just print what is written between the brackets of this keyword. You can print whatever you want to.
    The Syntax for using printf is:
    First you will write printf then open a round bracket like: printf(.
    Now open an inverted comma: printf("
    After that write the text you wanted to print.
    For Example
    printf("Hello Steemit
    after that you will close the inverted comma and the round bracket.
    printf("Hello Steemit")
    Last but not the least a ; (Semi-Colon) in the end of the line so that the IDE knows that here this line is ended by the user.
    So the syntax will look like:
    printf("Hello Steemit");

image.png

After that it is time to see the output what you have to do just simple Press F11 a box will appear just save your program and Boom.

image.png

Here is your output screen
Note: In the place of Hello Steemit you can write what ever you want to like i am going to print my name
For Example

image.png

I have written my name now. Lets see how it looks in the output screen.

image.png

This is the function of printf
I am pasting these sample codes if you wanted to try just copy paste them and try to print different things as well.

Program To Print "Hello Steemit"


#include<stdio.h>
main()
{
printf("Hello Steemit");
}

Program To Print Your Name


#include<stdio.h>
main()
{
printf("My Name Is Abdullah Bin Tahir");
}

That is al for today i hope you guys like it.
Will see you all in the next Lecture In Sha Allah with some more interesting work. Till than Allah Hafiz.
Steem Pakistan Divider 2.png

Subscribe STEEMIT PAKISTAN

Quick Delegation Links To earn delegation rewards

50 SP100 SP200 SP300 SP400 SP500 SP
1000 SP1500 SP2000 SP3000 SP4000 SP5000 SP


If you are reading this till the end lots of love and well wishes for you
Have A Nice Day
KNOW MORE ABOUT ME HERE
Regards
@abdullah.tahir

Authors get paid when people like you upvote their post.
If you enjoyed what you read here, create your account today and start earning FREE STEEM!
Sort Order:  

Nice post bro.