{"id":19258,"date":"2020-12-01T14:23:30","date_gmt":"2020-12-01T08:53:30","guid":{"rendered":"https:\/\/internshala.com\/blog\/?p=19258"},"modified":"2021-01-07T17:39:29","modified_gmt":"2021-01-07T12:09:29","slug":"getting-started-with-c-basics-of-c-language","status":"publish","type":"post","link":"https:\/\/internshala.com\/blog\/getting-started-with-c-basics-of-c-language\/","title":{"rendered":"Getting started with C: Basics of C language"},"content":{"rendered":"<p style=\"text-align: justify;\"><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-19275 aligncenter\" src=\"https:\/\/internshala.com\/wp-content\/uploads\/2020\/11\/Basics-of-C-language.png\" alt=\"\" width=\"595\" height=\"372\" \/><\/p>\n<p style=\"text-align: justify;\"><span style=\"font-weight: 400;\">The old-school C language, which was developed in 1972, still shapes a large part of the digital world. Any time that you use a computer, digital camera, or washing machine, you see C in action. This is because C has features of both an assembly language, which is closer to the hardware, and high-level languages such as Java and Python. If you want to find out more about the features and structure that makes C so cool for all generations of programmers, then read on!<\/span><\/p>\n<p style=\"text-align: justify;\"><b>Features of C<\/b><\/p>\n<p style=\"text-align: justify;\"><b>1. Fast and efficient &#8211; <\/b><span style=\"font-weight: 400;\">C is closer to machine code, which makes it faster. Although other languages such as Java have automated memory management and garbage collection, it has come at the cost of the processing speed. These tasks are handled manually by a C programmer. So, optimized code in C can execute really fast.<\/span><\/p>\n<p style=\"text-align: justify;\"><b>2. Procedural language &#8211; <\/b><span style=\"font-weight: 400;\">C solves a problem by breaking it down into subroutines, called functions. Thereafter, it follows an algorithmic approach, where the statements run sequentially. This approach makes the code more organised.\u00a0<\/span><\/p>\n<p style=\"text-align: justify;\"><b>3. Built-in functions in libraries &#8211; <\/b><span style=\"font-weight: 400;\">C has a huge number of built-in functions in its libraries which makes it easier to code.<\/span><\/p>\n<p style=\"text-align: justify;\"><b>4. Portable source code &#8211; <\/b><span style=\"font-weight: 400;\">Once a program is written in C, the source code can run similarly on different machines with almost no modification. However, C programmers need to be cautious and avoid errors that can make the code non-portable.<\/span><\/p>\n<p style=\"text-align: justify;\"><b>C programming tools<\/b><\/p>\n<p style=\"text-align: justify;\"><span style=\"font-weight: 400;\">To get started with programming in C, you will need the following tools and software:<\/span><\/p>\n<p style=\"text-align: justify;\"><b>1. Editor &#8211; <\/b><span style=\"font-weight: 400;\">You will first and foremost need a text editor where you can write your code. You can use an inbuilt one such as Notepad to start with or use other commonly used editors such as Vim, Visual Studio Code, Code: :Blocks, and Atom. Regardless of the editor you use, you need to save your source code with .c extension before compiling it.\u00a0<\/span><\/p>\n<p style=\"text-align: justify;\"><b>2. Preprocessor<\/b><span style=\"font-weight: 400;\"> &#8211; Before the actual compilation begins, a preprocessor includes the header files in the code.<\/span><\/p>\n<p style=\"text-align: justify;\"><b>3. Compiler &#8211; <\/b><span style=\"font-weight: 400;\">A compiler checks your source code for any errors and converts it into assembly code. While choosing a compiler, make sure that it is as updated as the version of C that you are using.<\/span><\/p>\n<p style=\"text-align: justify;\"><b>4. Assembler<\/b><span style=\"font-weight: 400;\"> &#8211; An assembler converts the assembly code into object code, which is a combination of binary 0s and 1s.\u00a0<\/span><\/p>\n<p style=\"text-align: justify;\"><b>5. Linker &#8211; <\/b><span style=\"font-weight: 400;\">The object code is linked with libraries that are necessary to run the application by a linker.<\/span><\/p>\n<p style=\"text-align: justify;\"><b>6. IDE &#8211; <\/b><span style=\"font-weight: 400;\">If you want to write and run your program in a graphical user interface, then you can use an Integrated Development Environment (IDE). An IDE consists of an editor, preprocessor, compiler,. assembler , and linker. So, it\u2019s a one stop shop for writing, compiling, and executing programs. For example, Eclipse is a free IDE that you can use for C programming.\u00a0<\/span><\/p>\n<p style=\"text-align: justify;\"><b>Fundamentals of C language<\/b><\/p>\n<p style=\"text-align: justify;\"><span style=\"font-weight: 400;\">The building blocks of C language consists of tokens<\/span><b>. <\/b><span style=\"font-weight: 400;\">Anything that you write in C except white space is a token. This includes variables, data types, literals, reserved keywords, functions, punctuation, etc.<\/span><\/p>\n<p style=\"text-align: justify;\"><b>Variables, data types, and literals<\/b><\/p>\n<p style=\"text-align: justify;\"><span style=\"font-weight: 400;\">A variable is the name given to a memory location to store data. You can store different types of data in a variable by using different data types. For example, <\/span><i><span style=\"font-weight: 400;\">char<\/span><\/i><span style=\"font-weight: 400;\"> is a data type that is used to store single characters such as alphabets, special characters, and single-digit numbers.<\/span><\/p>\n<p style=\"text-align: justify;\"><span style=\"font-weight: 400;\">char iLoveIcecream = \u2018Y\u2019;<\/span><\/p>\n<p style=\"text-align: justify;\"><span style=\"font-weight: 400;\">Data types in C can be divided into 3 categories:<\/span><\/p>\n<p style=\"text-align: justify;\"><b>1. Primary data types<\/b><span style=\"font-weight: 400;\"> &#8211; char, int, long,float, double.<\/span><\/p>\n<p style=\"text-align: justify;\"><b>2. Derived data types<\/b><span style=\"font-weight: 400;\"> &#8211; array, pointer, and string.<\/span><\/p>\n<p style=\"text-align: justify;\"><b>3. User-defined data types<\/b><span style=\"font-weight: 400;\"> &#8211; structure, union, and enum.<\/span><\/p>\n<p style=\"text-align: justify;\"><span style=\"font-weight: 400;\">Primary data types store integers and decimal values. They are of 5 types:<\/span><\/p>\n<p style=\"text-align: justify;\"><b>i. char<\/b><span style=\"font-weight: 400;\"> &#8211; It stores single characters and occupies 1 byte of memory. A series of characters is called a string. This is stored by using char variable name[]. You need to specify the number of characters within the square brackets. For example:<\/span><\/p>\n<p style=\"text-align: justify;\"><span style=\"font-weight: 400;\">char favouriteIcecream[25] = \u201cChocolate chip cookie\u201d;<\/span><\/p>\n<p style=\"text-align: justify;\"><span style=\"font-weight: 400;\">So, this string can only be 25 characters long including the spaces. \u201cChocolate chip cookie\u201d is a literal, which is a constant value that does not change during the execution of the program.<\/span><\/p>\n<p style=\"text-align: justify;\"><b>ii. int &#8211; <\/b><span style=\"font-weight: 400;\">This data type is used to store positive and negative numbers from -3210 to 2768. Depending on the operating system you use, it can take up 2 to 4 bytes. For example:<\/span><\/p>\n<p style=\"text-align: justify;\"><span style=\"font-weight: 400;\">int orders = 4;<\/span><\/p>\n<p style=\"text-align: justify;\"><b>iii. long &#8211; <\/b><span style=\"font-weight: 400;\">It is used to store long integers from -2143648 to 4276878 and occupies 4 to 8 bytes.<\/span><\/p>\n<p style=\"text-align: justify;\"><b>iv. float &#8211; <\/b><span style=\"font-weight: 400;\">It stores negative and positive decimal numbers and uses 4 bytes of memory. For example:<\/span><\/p>\n<p style=\"text-align: justify;\"><span style=\"font-weight: 400;\">float weight = 30.5;<\/span><\/p>\n<p style=\"text-align: justify;\"><b>v. double &#8211; <\/b><span style=\"font-weight: 400;\">It stores large decimal numbers that can contain 6 &#8211; 15 numbers after the decimal point. It occupies 8 bytes.<\/span><\/p>\n<p style=\"text-align: justify;\"><span style=\"font-weight: 400;\">Now that we know how to store values, let\u2019s find out how to print them. To print a character, you need to use the \u201c%c\u201d format specifier.<\/span><\/p>\n<p style=\"text-align: justify;\"><span style=\"font-weight: 400;\">printf (\u201c%c\u201d, iLoveIcecream);<\/span><\/p>\n<p style=\"text-align: justify;\"><span style=\"font-weight: 400;\">To print string, integer, long, float, and double, you can use \u201c%s\u201d, \u201c%d\u201d, \u201c%ld\u201d, \u201c%f\u201d, and \u201c%ld\u201d format specifiers. For example:<\/span><\/p>\n<p style=\"text-align: justify;\"><span style=\"font-weight: 400;\">printf (\u201c%s\u201d, favouriteIcecream);<\/span><\/p>\n<p style=\"text-align: justify;\"><span style=\"font-weight: 400;\">printf (\u201c%d\u201d, orders);<\/span><\/p>\n<p style=\"text-align: justify;\"><span style=\"font-weight: 400;\">printf (\u201c%f\u201d, weight);<\/span><\/p>\n<p style=\"text-align: justify;\"><b>Functions\u00a0<\/b><\/p>\n<p style=\"text-align: justify;\"><span style=\"font-weight: 400;\">A set of code that performs a particular task is called a function in C. There are a number of predefined functions in C such as:<\/span><\/p>\n<p style=\"text-align: justify;\"><b>1. main() function:<\/b><span style=\"font-weight: 400;\"> As you might infer from the name, it is the main function and you cannot skip it! This is the starting point for your program. So, when you press run, the code starts executing sequentially from the main function.\u00a0<\/span><\/p>\n<p style=\"text-align: justify;\"><b>2. printf() function:<\/b><span style=\"font-weight: 400;\"> printf() is used to print an output. This function will print the statements in the same line unless you add a new line character (\\n). For example:<\/span><\/p>\n<p style=\"text-align: center;\"><i><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-19289\" src=\"https:\/\/internshala.com\/wp-content\/uploads\/2020\/12\/printf-function1.png\" alt=\"\" width=\"634\" height=\"591\" \/>printf() without new line character<\/i><\/p>\n<p>&nbsp;<\/p>\n<p style=\"text-align: justify;\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-19291\" src=\"https:\/\/internshala.com\/wp-content\/uploads\/2020\/12\/printf-with-new-line2.png\" alt=\"\" width=\"473\" height=\"572\" \/><\/p>\n<p style=\"text-align: center;\"><i><span style=\"font-weight: 400;\">printf() with new line character<\/span><\/i><\/p>\n<p style=\"text-align: justify;\"><b>3. puts() function:<\/b><span style=\"font-weight: 400;\"> It prints the string and appends a new line character in the end, which takes the cursor to the next line.\u00a0<\/span><\/p>\n<p style=\"text-align: center;\"><i><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-19292\" src=\"https:\/\/internshala.com\/wp-content\/uploads\/2020\/12\/puts-function1.png\" alt=\"\" width=\"451\" height=\"575\" \/>puts() function<\/i><\/p>\n<p style=\"text-align: justify;\"><b>Curly braces<\/b><\/p>\n<p style=\"text-align: justify;\"><span style=\"font-weight: 400;\">A set of statements in C are contained within curly braces. In the above example, the body of the main() function is written inside curly braces.<\/span><\/p>\n<p style=\"text-align: justify;\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-19280\" src=\"https:\/\/internshala.com\/wp-content\/uploads\/2020\/12\/Curly-brackets.png\" alt=\"\" width=\"379\" height=\"120\" \/><\/p>\n<p style=\"text-align: justify;\"><b>Operators<\/b><\/p>\n<p style=\"text-align: justify;\"><span style=\"font-weight: 400;\">Symbols that are used to perform mathematical or logical operations on operands such as variables and literals are called operators. There are different types of operators in C:<\/span><\/p>\n<p style=\"text-align: justify;\"><b>1. Arithmetic operators &#8211; <\/b><span style=\"font-weight: 400;\">These are used to perform arithmetic operations such as addition (+), subtraction (-), multiplication (*), division (\/), and finding remainder (%). Equations are solved from left to right where multiplication (*), division (\/), and modulus (%) are given a higher precedence than addition (+) and subtraction (-).<\/span><\/p>\n<p style=\"text-align: justify;\"><b>2. Relational operators<\/b><span style=\"font-weight: 400;\"> &#8211; These are used to find out whether a condition is true or false. In C, a true condition is represented by 1 and a false condition is represented by 0. For example:<\/span><\/p>\n<p style=\"text-align: justify;\"><span style=\"font-weight: 400;\">int a =1;<\/span><\/p>\n<p style=\"text-align: justify;\"><span style=\"font-weight: 400;\">int b =2;<\/span><\/p>\n<p style=\"text-align: justify;\"><span style=\"font-weight: 400;\">int c = b&gt;a;\u00a0<\/span><\/p>\n<p style=\"text-align: justify;\"><span style=\"font-weight: 400;\">The \u2018c\u2019 will store 1 because \u2018b\u2019 is greater than \u2018a\u2019 is true.<\/span><\/p>\n<p style=\"text-align: justify;\"><span style=\"font-weight: 400;\">Other relational operators include greater than or equal to (&gt;=), less than (&lt;), less than or equal to (&lt;=), equal to (==), and not equal to (!=).<\/span><\/p>\n<p style=\"text-align: justify;\"><b>3. Logical operators\u00a0<\/b><\/p>\n<p style=\"text-align: justify;\"><b>i. Logical AND (&amp;&amp;)<\/b><span style=\"font-weight: 400;\"> &#8211; It returns 1 if both conditions are true, otherwise it returns 0. For example:<\/span><\/p>\n<p style=\"text-align: justify;\"><span style=\"font-weight: 400;\">int a = 1;<\/span><\/p>\n<p style=\"text-align: justify;\"><span style=\"font-weight: 400;\">int b = 4;<\/span><\/p>\n<p style=\"text-align: justify;\"><span style=\"font-weight: 400;\">int c = 5;<\/span><\/p>\n<p style=\"text-align: justify;\"><span style=\"font-weight: 400;\">int result = a&gt;b &amp;&amp; c&gt;b;<\/span><\/p>\n<p style=\"text-align: justify;\"><span style=\"font-weight: 400;\">When we run the program, 0 will be assigned to \u2018result\u2019 because a is not greater b.<\/span><\/p>\n<p style=\"text-align: justify;\"><b>ii. Logical OR (||)<\/b> &#8211; It returns 1 even if one condition is true. Let\u2019s take the same example as above:<\/p>\n<p style=\"text-align: justify;\"><span style=\"font-weight: 400;\">int a = 1;<\/span><\/p>\n<p style=\"text-align: justify;\"><span style=\"font-weight: 400;\">int b = 4;<\/span><\/p>\n<p style=\"text-align: justify;\"><span style=\"font-weight: 400;\">int c = 5;<\/span><\/p>\n<p style=\"text-align: justify;\"><span style=\"font-weight: 400;\">int result = a&gt;b || c&gt;b;<\/span><\/p>\n<p style=\"text-align: justify;\"><span style=\"font-weight: 400;\">When we run the program, 1 will be assigned to \u2018result\u2019 because c&gt;b is true.<\/span><\/p>\n<p style=\"text-align: justify;\"><b>iii. Logical NOT(!) &#8211; <\/b><span style=\"font-weight: 400;\">It is used to reverse a condition. For example:<\/span><\/p>\n<p style=\"text-align: justify;\"><span style=\"font-weight: 400;\">int a = 5;<\/span><\/p>\n<p style=\"text-align: justify;\"><span style=\"font-weight: 400;\">int b = 4;<\/span><\/p>\n<p style=\"text-align: justify;\"><span style=\"font-weight: 400;\">int r = !(a&gt;b);<\/span><\/p>\n<p style=\"text-align: justify;\"><span style=\"font-weight: 400;\">The result of a&gt;b is 0. The NOT operator will reverse this and assign 1 to \u2018r\u2019.<\/span><\/p>\n<p style=\"text-align: justify;\"><b>4. Assignment operators <\/b><span style=\"font-weight: 400;\">&#8211; The simplest assignment operator is \u2018=\u2019 which assigns the value from right to left.<\/span><\/p>\n<p style=\"text-align: justify;\"><span style=\"font-weight: 400;\">int year = 2020;<\/span><\/p>\n<p style=\"text-align: justify;\"><span style=\"font-weight: 400;\">Other assignment operators such as +-=, -=, *=, \/=, and %= can be used to avoid repetition. For example:<\/span><\/p>\n<p style=\"text-align: justify;\"><span style=\"font-weight: 400;\">int a = a+b;<\/span><\/p>\n<p style=\"text-align: justify;\"><span style=\"font-weight: 400;\">This statement can also be written as:<\/span><\/p>\n<p style=\"text-align: justify;\"><span style=\"font-weight: 400;\">int a +=b;<\/span><\/p>\n<p style=\"text-align: justify;\"><b>5. Increment and decrement operators &#8211; <\/b><span style=\"font-weight: 400;\">They are used to increase or decrease the value of the variable by 1. This operation can be performed by postfix operators or prefix operators.<\/span><\/p>\n<p style=\"text-align: justify;\"><span style=\"font-weight: 400;\">In the case of postfix operators, the variable value is first used and then increased or decreased by 1. For example:<\/span><\/p>\n<p style=\"text-align: justify;\"><span style=\"font-weight: 400;\">int books = 5;<\/span><\/p>\n<p style=\"text-align: justify;\"><span style=\"font-weight: 400;\">int newBooks = books++;<\/span><\/p>\n<p style=\"text-align: justify;\"><span style=\"font-weight: 400;\">When this line is executed, the value of newBooks will be 5, and the value of books will increase by 1 and become 6.<\/span><\/p>\n<p style=\"text-align: justify;\"><span style=\"font-weight: 400;\">While using the prefix operators, the variable value is first increased or decreased by 1 and then used. For example:<\/span><\/p>\n<p style=\"text-align: justify;\"><span style=\"font-weight: 400;\">int chocolates = 4;<\/span><\/p>\n<p style=\"text-align: justify;\"><span style=\"font-weight: 400;\">int chocolatesLeft = &#8211;chocolates;<\/span><\/p>\n<p style=\"text-align: justify;\"><span style=\"font-weight: 400;\">On executing this line, the value of chocolates will reduce by 1 and become 3. This value is assigned to chocolatesLeft.<\/span><\/p>\n<p style=\"text-align: justify;\"><b>Conditional statements<\/b><\/p>\n<p style=\"text-align: justify;\"><span style=\"font-weight: 400;\">These are used when the programmer needs to run different statements depending on a condition. For example, the if-else statement.<\/span><\/p>\n<p style=\"text-align: justify;\"><span style=\"font-weight: 400;\">if (age&gt;=18)\u00a0<\/span><\/p>\n<p style=\"text-align: justify;\"><span style=\"font-weight: 400;\">printf (\u201cYou can vote\u201d); \/\/This will be printed if the age is greater than or equal to 18<\/span><\/p>\n<p style=\"text-align: justify;\"><span style=\"font-weight: 400;\">else<\/span><\/p>\n<p style=\"text-align: justify;\"><span style=\"font-weight: 400;\">printf ( \u201cYou can\u2019t vote\u201d); \/\/This will be printed if the age is less than 18<\/span><\/p>\n<p style=\"text-align: justify;\"><span style=\"font-weight: 400;\">Other conditional statements include ternary operator, if-else-if ladder, and switch.<\/span><\/p>\n<p style=\"text-align: justify;\"><span style=\"font-weight: 400;\">The ternary operator uses the following format:<\/span><\/p>\n<p style=\"text-align: justify;\"><span style=\"font-weight: 400;\">condition? expression 1: expression 2\u00a0<\/span><\/p>\n<p style=\"text-align: justify;\"><span style=\"font-weight: 400;\">If the condition is true, then the first expression will be returned. Otherwise, the second expression is returned. The returned value can be stored in a variable. For example:<\/span><\/p>\n<p style=\"text-align: justify;\"><span style=\"font-weight: 400;\">int discount = (bill&gt;=500)? 100: 0;<\/span><\/p>\n<p style=\"text-align: justify;\"><span style=\"font-weight: 400;\">If the bill is greater than or equal to 500, then the discount is 100, else it is 0.<\/span><\/p>\n<p style=\"text-align: justify;\"><span style=\"font-weight: 400;\">The else-if ladder can be used when we have a number of conditions. For example, let\u2019s write code for checking whether a number is even or odd.<\/span><\/p>\n<p style=\"text-align: justify;\"><span style=\"font-weight: 400;\">if (number ==1) \/\/ if the number is 1<\/span><\/p>\n<p style=\"text-align: justify;\"><span style=\"font-weight: 400;\">puts (\u201c1 is a special number\u201d);<\/span><\/p>\n<p style=\"text-align: justify;\"><span style=\"font-weight: 400;\">else if (number!=0 &amp;&amp; number%2==0) \/\/ if the number is divisible by 2<\/span><\/p>\n<p style=\"text-align: justify;\"><span style=\"font-weight: 400;\">puts (\u201cThis is an even number);<\/span><\/p>\n<p style=\"text-align: justify;\"><span style=\"font-weight: 400;\">else if (number!=0 &amp;&amp; (number%2)!=0) \/\/ if the number is not divisible by 2<\/span><\/p>\n<p style=\"text-align: justify;\"><span style=\"font-weight: 400;\">puts (\u201cThis is an odd number);<\/span><\/p>\n<p style=\"text-align: justify;\"><span style=\"font-weight: 400;\">else<\/span><\/p>\n<p style=\"text-align: justify;\"><span style=\"font-weight: 400;\">puts (\u201cPlease enter another number\u201d);<\/span><\/p>\n<p style=\"text-align: justify;\"><span style=\"font-weight: 400;\">In the above-mentioned example, the program will execute sequentially. If the first statement is true, it will print the corresponding statement and skip the rest of the ladder.<\/span><\/p>\n<p style=\"text-align: justify;\"><b><i>return<\/i><\/b><b> statement<\/b><\/p>\n<p style=\"text-align: justify;\"><span style=\"font-weight: 400;\">At the end of every program body is a return statement, which is used to terminate the program.<\/span><\/p>\n<p style=\"text-align: justify;\"><b>Comments<\/b><\/p>\n<p><span style=\"font-weight: 400;\">You can leave comments on your program to help the reader understand it better. They also help with documenting your program. So, if you face any error in your application, you can refer to the comments. Single-line comments begin with a two forward slashes (\\\\) whereas multi-line comments begin with \/* and end with *\/. For example:<\/span><\/p>\n<p style=\"text-align: justify;\"><span style=\"font-weight: 400;\">\/*\u00a0<\/span><\/p>\n<p style=\"text-align: justify;\"><span style=\"font-weight: 400;\">This is my first C program<\/span><\/p>\n<p style=\"text-align: justify;\"><span style=\"font-weight: 400;\">I am learning how to print statements\u00a0<\/span><\/p>\n<p style=\"text-align: justify;\"><span style=\"font-weight: 400;\">*\/<\/span><\/p>\n<p style=\"text-align: justify;\"><span style=\"font-weight: 400;\">Comments are not scanned by the compiler so you don\u2019t need to follow the C syntax while writing them.\u00a0<\/span><\/p>\n<p style=\"text-align: justify;\"><b>I know the basics of the C language. How do I write a C program now?<\/b><\/p>\n<p style=\"text-align: justify;\"><b>1. Documenting: <\/b><span style=\"font-weight: 400;\">You can begin a C program by giving details such as author name, date, and objective of the program. You can write these as multi-line comments using \/* and *\/. Although documentation is not necessary, it is considered a good coding practice.\u00a0<\/span><\/p>\n<p style=\"text-align: justify;\"><b>2. Including links: <\/b><span style=\"font-weight: 400;\">This is used to include header files that are needed to run the program such as &lt;stdio.h&gt;. This file contains scanf() and printf() functions that are used to take an input from the keyboard and print the output. You can include the header file in a program by using the following syntax:<\/span><\/p>\n<p style=\"text-align: justify;\"><span style=\"font-weight: 400;\">#include &lt;stdio.h&gt;<\/span><\/p>\n<p style=\"text-align: justify;\"><b>3. Declaring functions and variables: <\/b><span style=\"font-weight: 400;\">While declaring a function in C, you need to write its name, return type, and parameters. For example, the main() function in Java is written as:<\/span><\/p>\n<p style=\"text-align: justify;\"><span style=\"font-weight: 400;\">int main(int argc, char *argv[]) {\u00a0<\/span><\/p>\n<p style=\"text-align: justify;\"><span style=\"font-weight: 400;\">\/\/function body<\/span><\/p>\n<p style=\"text-align: justify;\"><span style=\"font-weight: 400;\">}<\/span><\/p>\n<p style=\"text-align: justify;\"><span style=\"font-weight: 400;\">The \u2018int\u2019 is the return type, which generally means that the code needs to terminate with a return 0 statement.<\/span><\/p>\n<p style=\"text-align: justify;\"><span style=\"font-weight: 400;\">Variables that are declared within each function are called local variables and they can only be used within that particular function. On the other hand, variables declared outside function(s) can be used throughout the program and are called global variables.<\/span><\/p>\n<p style=\"text-align: justify;\"><b>4. Taking user input and printing output: <\/b><span style=\"font-weight: 400;\">As mentioned before,<\/span> <span style=\"font-weight: 400;\">if you want to take an input from the user and display an output, you need to include a stdio header file. This file contains scanf() and printf() functions that are used to take an input from the keyboard and print the output. For example, if you want to calculate how much a customer needs to pay, you will need an integer value. So, you can use the following format:<\/span><\/p>\n<p style=\"text-align: justify;\"><span style=\"font-weight: 400;\">int orders;<\/span><\/p>\n<p style=\"text-align: justify;\"><span style=\"font-weight: 400;\">scanf(\u201c%d\u201d, &amp;orders);<\/span><\/p>\n<p style=\"text-align: justify;\"><span style=\"font-weight: 400;\">\u00a0<\/span><span style=\"font-weight: 400;\">As you can see, \u201c%d\u201d is the format specifier for accepting integer values.The \u2018&amp;\u2019 sign will assign the value to the address of \u2018orders\u2019.\u00a0<\/span><\/p>\n<p style=\"text-align: justify;\"><b>5. Executing the program: <\/b><span style=\"font-weight: 400;\">To begin with, you can run your code on online compilers or you can install a free compiler, and use the command prompt. You can also download an IDE.<\/span><\/p>\n<p style=\"text-align: justify;\"><span style=\"font-weight: 400;\">Now that we know the steps involved, let\u2019s write our first C program!\u00a0<\/span><\/p>\n<p style=\"text-align: justify;\"><span style=\"font-weight: 400;\">Let\u2019s write a C program to calculate the bill of a laptop after adding GST.<\/span><\/p>\n<p style=\"text-align: justify;\"><span style=\"font-weight: 400;\">Before you begin writing the program, you will need to install a compiler and an IDE. We have installed <\/span><a href=\"http:\/\/www.codeblocks.org\/downloads\/binaries\"><span style=\"font-weight: 400;\">Code::Blocks<\/span><\/a><span style=\"font-weight: 400;\">, which is an IDE and MinGW with a GNU GCC compiler.\u00a0<\/span><\/p>\n<p style=\"text-align: justify;\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter wp-image-19283\" src=\"https:\/\/internshala.com\/wp-content\/uploads\/2020\/12\/Installing-CodeBlocks.png\" alt=\"\" width=\"731\" height=\"411\" \/><\/p>\n<p style=\"text-align: justify;\"><span style=\"font-weight: 400;\">Once you have installed Code::Blocks, make sure that the default compiler is GNU GCC compiler.\u00a0<\/span><\/p>\n<p style=\"text-align: justify;\"><span style=\"font-weight: 400;\">When the set up is complete, open Code::Blocks and click on File&gt;Empty file.\u00a0<\/span><\/p>\n<p style=\"text-align: justify;\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter wp-image-19281\" src=\"https:\/\/internshala.com\/wp-content\/uploads\/2020\/12\/File.png\" alt=\"\" width=\"729\" height=\"371\" \/><\/p>\n<p style=\"text-align: justify;\"><span style=\"font-weight: 400;\">Next, save this file as Bill.c. Make sure you use the \u2018.c\u2019 extension.\u00a0<\/span><\/p>\n<p style=\"text-align: justify;\"><span style=\"font-weight: 400;\">While writing the program, the first step should be to come up with an algorithm to solve the problem at hand. In our program where we calculate the GST, we will follow the steps mentioned below.<\/span><\/p>\n<p style=\"text-align: justify;\"><span style=\"font-weight: 400;\">1. Declare three variables for MRP, GST, and bill.<\/span><\/p>\n<p style=\"text-align: justify;\"><span style=\"font-weight: 400;\">2. Take MRP as input from the user.<\/span><\/p>\n<p style=\"text-align: justify;\"><span style=\"font-weight: 400;\">3. Calculate 18% GST on the amount.<\/span><\/p>\n<p style=\"text-align: justify;\"><span style=\"font-weight: 400;\">4. Calculate the bill by adding the MRP and GST.<\/span><\/p>\n<p style=\"text-align: justify;\"><span style=\"font-weight: 400;\">5. Print the bill.<\/span><\/p>\n<p style=\"text-align: justify;\"><span style=\"font-weight: 400;\">Now that we know the steps, let\u2019s write the program.<\/span><\/p>\n<p>\/*<br \/>\nAuthor: Internshala<br \/>\nTopic: First program in C<br \/>\n*\/<\/p>\n<p>#include &lt;stdio.h&gt;<\/p>\n<p>int main(int argc, char *argv) {<\/p>\n<p>float mrp;<br \/>\nfloat gst;<br \/>\nfloat bill;<\/p>\n<p>puts(&#8220;Enter MRP&#8221;);<\/p>\n<p>scanf(&#8220;%f&#8221;, &amp;mrp); \/\/taking input<\/p>\n<p>gst = (18*mrp)\/100; \/\/calculating GST as 18% of the MRP<\/p>\n<p>bill = mrp+gst;<\/p>\n<p>printf(&#8220;The bill is %.1f&#8221;, bill); \/\/printing the bill<\/p>\n<p>return 0;<br \/>\n}<\/p>\n<p style=\"text-align: justify;\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter wp-image-19284\" src=\"https:\/\/internshala.com\/wp-content\/uploads\/2020\/12\/first-C-program.png\" alt=\"Writing your first program in C language\" width=\"742\" height=\"306\" \/><\/p>\n<p style=\"text-align: justify;\"><span style=\"font-weight: 400;\">Next, compile the file and check for any errors.<\/span><\/p>\n<p style=\"text-align: justify;\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter wp-image-19285\" src=\"https:\/\/internshala.com\/wp-content\/uploads\/2020\/12\/Compiling-C-program.png\" alt=\"Compiling a C program in Code: :Blocks\" width=\"736\" height=\"420\" \/><\/p>\n<p style=\"text-align: justify;\"><span style=\"font-weight: 400;\">Finally, build and run the program. You should see a window to enter your input.<\/span><\/p>\n<p style=\"text-align: justify;\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter wp-image-19286\" src=\"https:\/\/internshala.com\/wp-content\/uploads\/2020\/12\/Enter-input.png\" alt=\"Enter input in a C program\" width=\"744\" height=\"367\" \/><\/p>\n<p style=\"text-align: justify;\"><span style=\"font-weight: 400;\">Lastly, press enter to see the output.<\/span><\/p>\n<p style=\"text-align: justify;\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter wp-image-19288\" src=\"https:\/\/internshala.com\/wp-content\/uploads\/2020\/12\/Print-output.png\" alt=\"Print output in C\" width=\"748\" height=\"383\" \/><\/p>\n<p style=\"text-align: justify;\"><span style=\"font-weight: 400;\">That\u2019s it. You have written and executed your first program in C! Yay!<\/span><\/p>\n<p style=\"text-align: justify;\"><span style=\"font-weight: 400;\">This was a mini guide on how to get started with programming in C. If you enjoyed writing your first C program and want to dive deeper, then check out Internshala Trainings\u2019 <\/span><a href=\"https:\/\/trainings.internshala.com\/c-plus-plus-training\/?utm_source=IS_Blog&amp;utm_medium=getting-started-with-c\"><span style=\"font-weight: 400;\">Programming with C and C++<\/span><\/a><span style=\"font-weight: 400;\">. You can use coupon code BLOG10 to get a discount of 10%.<\/span><\/p>\n<aside class=\"mashsb-container mashsb-main \"><div class=\"mashsb-box\"><div class=\"mashsb-count mash-medium\" style=\"float:left\"><div class=\"counts mashsbcount\">276<\/div><span class=\"mashsb-sharetext\">SHARES<\/span><\/div><div class=\"mashsb-buttons\"><a class=\"mashicon-facebook mash-medium mashsb-noshadow\" href=\"https:\/\/www.facebook.com\/sharer.php?u=https%3A%2F%2Finternshala.com%2Fblog%2Fgetting-started-with-c-basics-of-c-language%2F\" target=\"_top\" rel=\"nofollow\"><span class=\"icon\"><\/span><span class=\"text\">Share&nbsp;on&nbsp;Facebook<\/span><\/a><a class=\"mashicon-subscribe mash-medium mashsb-noshadow\" href=\"#\" target=\"_top\" rel=\"nofollow\"><span class=\"icon\"><\/span><span class=\"text\">Get&nbsp;Your&nbsp;Dream&nbsp;Internship<\/span><\/a><div class=\"onoffswitch2 mash-medium mashsb-noshadow\" style=\"display:none\"><\/div><\/div>\n            <\/div>\n                <div style=\"clear:both\"><\/div><\/aside>\n            <!-- Share buttons by mashshare.net - Version: 4.0.42-->","protected":false},"excerpt":{"rendered":"<p>The old-school C language, which was developed in 1972, still shapes a large part of the digital world. Any time that you use a computer, digital camera, or washing machine,<\/p>\n","protected":false},"author":5355,"featured_media":19265,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[675,3943,4134,1594,4171],"tags":[539],"acf":[],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v22.1 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Getting started with C: Basics of C language - Internshala blog<\/title>\n<meta name=\"description\" content=\"A beginner-friendly guide to basics of C language. Learn about the features, tools, and tokens. Finally, test your understanding by writing your first C program!\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/internshala.com\/blog\/getting-started-with-c-basics-of-c-language\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Getting started with C: Basics of C language - Internshala blog\" \/>\n<meta property=\"og:description\" content=\"A beginner-friendly guide to basics of C language. Learn about the features, tools, and tokens. Finally, test your understanding by writing your first C program!\" \/>\n<meta property=\"og:url\" content=\"https:\/\/internshala.com\/blog\/getting-started-with-c-basics-of-c-language\/\" \/>\n<meta property=\"og:site_name\" content=\"Internshala blog\" \/>\n<meta property=\"article:published_time\" content=\"2020-12-01T08:53:30+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2021-01-07T12:09:29+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/internshala.com\/blog\/wp-content\/uploads\/2020\/11\/Basics-of-C.png\" \/>\n\t<meta property=\"og:image:width\" content=\"390\" \/>\n\t<meta property=\"og:image:height\" content=\"205\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/png\" \/>\n<meta name=\"author\" content=\"Internshala\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Internshala\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"13 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/internshala.com\/blog\/getting-started-with-c-basics-of-c-language\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/internshala.com\/blog\/getting-started-with-c-basics-of-c-language\/\"},\"author\":{\"name\":\"Internshala\",\"@id\":\"https:\/\/internshala.com\/blog\/#\/schema\/person\/f0be3a17aa62a7b75486919fd00ecb20\"},\"headline\":\"Getting started with C: Basics of C language\",\"datePublished\":\"2020-12-01T08:53:30+00:00\",\"dateModified\":\"2021-01-07T12:09:29+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/internshala.com\/blog\/getting-started-with-c-basics-of-c-language\/\"},\"wordCount\":2508,\"commentCount\":4,\"publisher\":{\"@id\":\"https:\/\/internshala.com\/blog\/#organization\"},\"keywords\":[\"C programming\"],\"articleSection\":[\"Available Trainings\",\"e-Learning\",\"Learning Tracks\",\"Programming\",\"Training SEO articles\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/internshala.com\/blog\/getting-started-with-c-basics-of-c-language\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/internshala.com\/blog\/getting-started-with-c-basics-of-c-language\/\",\"url\":\"https:\/\/internshala.com\/blog\/getting-started-with-c-basics-of-c-language\/\",\"name\":\"Getting started with C: Basics of C language - Internshala blog\",\"isPartOf\":{\"@id\":\"https:\/\/internshala.com\/blog\/#website\"},\"datePublished\":\"2020-12-01T08:53:30+00:00\",\"dateModified\":\"2021-01-07T12:09:29+00:00\",\"description\":\"A beginner-friendly guide to basics of C language. Learn about the features, tools, and tokens. Finally, test your understanding by writing your first C program!\",\"breadcrumb\":{\"@id\":\"https:\/\/internshala.com\/blog\/getting-started-with-c-basics-of-c-language\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/internshala.com\/blog\/getting-started-with-c-basics-of-c-language\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/internshala.com\/blog\/getting-started-with-c-basics-of-c-language\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/internshala.com\/blog\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Learning Tracks\",\"item\":\"https:\/\/internshala.com\/blog\/learning-tracks\/\"},{\"@type\":\"ListItem\",\"position\":3,\"name\":\"Programming\",\"item\":\"https:\/\/internshala.com\/blog\/learning-tracks\/programming\/\"},{\"@type\":\"ListItem\",\"position\":4,\"name\":\"Getting started with C: Basics of C language\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/internshala.com\/blog\/#website\",\"url\":\"https:\/\/internshala.com\/blog\/\",\"name\":\"Internshala blog\",\"description\":\"Your favourite senior outside college\",\"publisher\":{\"@id\":\"https:\/\/internshala.com\/blog\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/internshala.com\/blog\/?s={search_term_string}\"},\"query-input\":\"required name=search_term_string\"}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\/\/internshala.com\/blog\/#organization\",\"name\":\"Internshala blog\",\"url\":\"https:\/\/internshala.com\/blog\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/internshala.com\/blog\/#\/schema\/logo\/image\/\",\"url\":\"https:\/\/internshala.com\/blog\/wp-content\/uploads\/2023\/08\/LOGO-1.png\",\"contentUrl\":\"https:\/\/internshala.com\/blog\/wp-content\/uploads\/2023\/08\/LOGO-1.png\",\"width\":112,\"height\":31,\"caption\":\"Internshala blog\"},\"image\":{\"@id\":\"https:\/\/internshala.com\/blog\/#\/schema\/logo\/image\/\"}},{\"@type\":\"Person\",\"@id\":\"https:\/\/internshala.com\/blog\/#\/schema\/person\/f0be3a17aa62a7b75486919fd00ecb20\",\"name\":\"Internshala\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/internshala.com\/blog\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/internshala.com\/blog\/wp-content\/uploads\/2025\/10\/IS-Logo-96x96.png\",\"contentUrl\":\"https:\/\/internshala.com\/blog\/wp-content\/uploads\/2025\/10\/IS-Logo-96x96.png\",\"caption\":\"Internshala\"},\"description\":\"Internshala is India\u2019s leading early-career platform, helping students and fresh graduates find internships, jobs, and online trainings. With over a decade of experience in empowering young professionals, Internshala shares insights and resources to help them build successful careers.\",\"sameAs\":[\"http:\/\/blog.internshala.com\",\"https:\/\/www.linkedin.com\/company\/internshala\/\"],\"url\":\"https:\/\/internshala.com\/blog\/author\/internshala\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Getting started with C: Basics of C language - Internshala blog","description":"A beginner-friendly guide to basics of C language. Learn about the features, tools, and tokens. Finally, test your understanding by writing your first C program!","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/internshala.com\/blog\/getting-started-with-c-basics-of-c-language\/","og_locale":"en_US","og_type":"article","og_title":"Getting started with C: Basics of C language - Internshala blog","og_description":"A beginner-friendly guide to basics of C language. Learn about the features, tools, and tokens. Finally, test your understanding by writing your first C program!","og_url":"https:\/\/internshala.com\/blog\/getting-started-with-c-basics-of-c-language\/","og_site_name":"Internshala blog","article_published_time":"2020-12-01T08:53:30+00:00","article_modified_time":"2021-01-07T12:09:29+00:00","og_image":[{"width":390,"height":205,"url":"https:\/\/internshala.com\/blog\/wp-content\/uploads\/2020\/11\/Basics-of-C.png","type":"image\/png"}],"author":"Internshala","twitter_card":"summary_large_image","twitter_misc":{"Written by":"Internshala","Est. reading time":"13 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/internshala.com\/blog\/getting-started-with-c-basics-of-c-language\/#article","isPartOf":{"@id":"https:\/\/internshala.com\/blog\/getting-started-with-c-basics-of-c-language\/"},"author":{"name":"Internshala","@id":"https:\/\/internshala.com\/blog\/#\/schema\/person\/f0be3a17aa62a7b75486919fd00ecb20"},"headline":"Getting started with C: Basics of C language","datePublished":"2020-12-01T08:53:30+00:00","dateModified":"2021-01-07T12:09:29+00:00","mainEntityOfPage":{"@id":"https:\/\/internshala.com\/blog\/getting-started-with-c-basics-of-c-language\/"},"wordCount":2508,"commentCount":4,"publisher":{"@id":"https:\/\/internshala.com\/blog\/#organization"},"keywords":["C programming"],"articleSection":["Available Trainings","e-Learning","Learning Tracks","Programming","Training SEO articles"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/internshala.com\/blog\/getting-started-with-c-basics-of-c-language\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/internshala.com\/blog\/getting-started-with-c-basics-of-c-language\/","url":"https:\/\/internshala.com\/blog\/getting-started-with-c-basics-of-c-language\/","name":"Getting started with C: Basics of C language - Internshala blog","isPartOf":{"@id":"https:\/\/internshala.com\/blog\/#website"},"datePublished":"2020-12-01T08:53:30+00:00","dateModified":"2021-01-07T12:09:29+00:00","description":"A beginner-friendly guide to basics of C language. Learn about the features, tools, and tokens. Finally, test your understanding by writing your first C program!","breadcrumb":{"@id":"https:\/\/internshala.com\/blog\/getting-started-with-c-basics-of-c-language\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/internshala.com\/blog\/getting-started-with-c-basics-of-c-language\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/internshala.com\/blog\/getting-started-with-c-basics-of-c-language\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/internshala.com\/blog\/"},{"@type":"ListItem","position":2,"name":"Learning Tracks","item":"https:\/\/internshala.com\/blog\/learning-tracks\/"},{"@type":"ListItem","position":3,"name":"Programming","item":"https:\/\/internshala.com\/blog\/learning-tracks\/programming\/"},{"@type":"ListItem","position":4,"name":"Getting started with C: Basics of C language"}]},{"@type":"WebSite","@id":"https:\/\/internshala.com\/blog\/#website","url":"https:\/\/internshala.com\/blog\/","name":"Internshala blog","description":"Your favourite senior outside college","publisher":{"@id":"https:\/\/internshala.com\/blog\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/internshala.com\/blog\/?s={search_term_string}"},"query-input":"required name=search_term_string"}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/internshala.com\/blog\/#organization","name":"Internshala blog","url":"https:\/\/internshala.com\/blog\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/internshala.com\/blog\/#\/schema\/logo\/image\/","url":"https:\/\/internshala.com\/blog\/wp-content\/uploads\/2023\/08\/LOGO-1.png","contentUrl":"https:\/\/internshala.com\/blog\/wp-content\/uploads\/2023\/08\/LOGO-1.png","width":112,"height":31,"caption":"Internshala blog"},"image":{"@id":"https:\/\/internshala.com\/blog\/#\/schema\/logo\/image\/"}},{"@type":"Person","@id":"https:\/\/internshala.com\/blog\/#\/schema\/person\/f0be3a17aa62a7b75486919fd00ecb20","name":"Internshala","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/internshala.com\/blog\/#\/schema\/person\/image\/","url":"https:\/\/internshala.com\/blog\/wp-content\/uploads\/2025\/10\/IS-Logo-96x96.png","contentUrl":"https:\/\/internshala.com\/blog\/wp-content\/uploads\/2025\/10\/IS-Logo-96x96.png","caption":"Internshala"},"description":"Internshala is India\u2019s leading early-career platform, helping students and fresh graduates find internships, jobs, and online trainings. With over a decade of experience in empowering young professionals, Internshala shares insights and resources to help them build successful careers.","sameAs":["http:\/\/blog.internshala.com","https:\/\/www.linkedin.com\/company\/internshala\/"],"url":"https:\/\/internshala.com\/blog\/author\/internshala\/"}]}},"_links":{"self":[{"href":"https:\/\/internshala.com\/blog\/wp-json\/wp\/v2\/posts\/19258"}],"collection":[{"href":"https:\/\/internshala.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/internshala.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/internshala.com\/blog\/wp-json\/wp\/v2\/users\/5355"}],"replies":[{"embeddable":true,"href":"https:\/\/internshala.com\/blog\/wp-json\/wp\/v2\/comments?post=19258"}],"version-history":[{"count":0,"href":"https:\/\/internshala.com\/blog\/wp-json\/wp\/v2\/posts\/19258\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/internshala.com\/blog\/wp-json\/wp\/v2\/media\/19265"}],"wp:attachment":[{"href":"https:\/\/internshala.com\/blog\/wp-json\/wp\/v2\/media?parent=19258"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/internshala.com\/blog\/wp-json\/wp\/v2\/categories?post=19258"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/internshala.com\/blog\/wp-json\/wp\/v2\/tags?post=19258"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}