Getting started with C programming Public

Getting started with C programming

Diego Melo
Course by Diego Melo, updated more than 1 year ago Contributors

Description

This course gives you a basic , hands-on introduction to programming using the C language. You will learn how to write simple C programs without having to get into the technical details of the language. This focus on practical learning makes it easier for you to get started with coding right away. No previous knowledge in programming is needed.

Module Information

No tags specified
Let us start out with a basic C program and get to know what all the elements that go into making a C program are.    #include<stdio.h> void main() {    printf("My first C program!"); }   This is one of the simplest C programs you will come across. This program displays "My first C program!" when you run it. You can try it on your own on Codepad: http://codepad.org/CPtNE7LS See the first line? The hash (#) symbol does not make it a Twitter hashtag! This line tells your computer to include something called stdio.h at the beginning of this code. So, when this code is executed, all the content present in a file called stdio.h is attached at the beginning of your program. This particular file—stdio.h, or the Standard Input/Output Header File—contains the things you need to be able to use your program to accept an input and display an output. It is sort of like having a vocal cord. Without it, you cannot speak. Just the same way, if you don't have stdio.h included in your programs, they will not be able to display any output (or accept any input). The second line begins the main part of our program. All the stuff that we want to do must be written inside the curly braces (see fourth line and sixth line). The line printf("My first C program!") tells your computer that you want to display whatever is written inside the double quotes. In our case, this would be My first C program! See the semicolon at the end of the line? It is similar to a full stop (or period) in English. This semi-colon tells the computer that the line or statement has ended and whatever comes next is a different statement. Let us now change the inside of the program and get this code to do something else. #include<stdio.h> void main() {    printf("%i", 3+4); } [Try it for yourself: http://codepad.org/kROgOoqk]   See the fourth line? This line will display the result of 3+4. The %i tells your computer that the result you want to display is an integer. Try using printf(“3+4”); instead of this line on a fresh Codepad page and see what happens. Now let us try the same program with a little bit of modification. #include<stdio.h> void main() {    printf("%i and %i", 3+4, 3-4); } http://codepad.org/ldf2evVN You probably know by now what the output will be, even without executing the program. Just as addition and subtraction are done by using the operations + and -, we use * for multiplication and / for division. Try this out: #include<stdio.h> void main() {    printf("%i and %i and %i and %i", 4+2, 4-2, 4*2, 4/2); } http://codepad.org/QqD7tW66 Tomorrow, we will learn all about constants and variables. Till then, happy coding!
Show less
No tags specified
Hey there! It's good to see you again. Today, we'll be tackling variables and constants, which will form a very important part of every program that you write. A constant, as the name suggests, is a value that does not change. Remember the program we worked on yesterday? Here you go: #include<stdio.h> void main() {     printf("%i and %i and %i and %i", 4+2, 4-2, 4*2, 4/2); }http://codepad.org/QqD7tW66 The values 4 and 2 are called constants, simply because they remain the same. Now what happens if we want to change the value from 4 to 6? You would need to go through the whole program and change each 4 to 6 one by one. But wouldn’t it be nice if we had a lazy way out? Well, we do! Say hello to variables. So what is a variable? Err, anything that varies from time to time? Well, yes, but for computers, a variable is more like a container. Just like you can store any number of candies in your hidden-from-everyone-else candy jar, you can store any value in a variable. If you can recall elementary algebra, we're talking about the same thing here. So let's change this program to include two variables:  a and b. #include<stdio.h> void main() {     int a=4, b=2;     printf("%i and %i and %i and %i", a+b, a-b, a*b, a/b); }http://codepad.org/ZCs4OKS5 Now all we need to do is change the value of a from 4 to 6 in the first line and we are done! The word int tells your computer that the type of variable we are interested in is an integer. There are other types of variables as well. We will work only with int,float (real numbers with a decimal point), and char (characters) in this course. Think of the various types of containers you have in your kitchen: a jug for orange juice, a dish for butter, a jar for sugar. Storing orange juice in a butter dish would be pretty inefficient. Likewise, we need to store values in containers that are specially made for holding them. And since computers are pretty dumb unless you tell them what to do, you have to tell your computer what type of container (variable) you want to use. Let's see different types of variables in action. #include<stdio.h> void main() {     int a=4, b=2;     char x='z';     float m=6.0, n=3.0;     printf("%i \n",a+b);     printf("%c \n",x);     printf("%f", m/n); }http://codepad.org/lurWJKYq See how we are using %c to print character variables and %f to print float variables? It is also common to use %d to print integers, instead of using %i. The \n is to specify that we want the next output on a new line. Make sure you've got the backslash (\) and not the commonly used front slash (/). The front slash is for division. Also keep in mind how we are using a separate line to declare each kind of variable—a separate line for the integers and a separate line for the floats. You might be wondering what's with the a,b,x,m, and n. You can use almost any name for your variable, as long as it is not words like float or int or main. Feel free to get creative with the names. #include<stdio.h> void main() {    char first_initial = 'S', second_initial = 'D';    printf("My name is %c.%c.", first_initial, second_initial); }http://codepad.org/JZJPdE6N
Show less
No tags specified
Hello! I hope you’ve gotten the hang of using the different types of variables now. Now what happens if we need to store ten integer values? The usual way would be to name all ten variables one by one, like so: int a, b, c, d, e, f, g, h, i, j; Reminds me of kindergarten, but doable. Now what if we had to store 100 integer values? Okay, now that's a problem. Arrays to the rescue! An array is a group of variables of the same type. So, if we have an integer array of size 10, we could store 10 integers together without having to name each of them separately. We just need to name our array. Let's take an example: #include<stdio.h> void main() {     int a[10]={1,2,3,4,5,6,7,8,9,10};     printf("%d %d %d %d", a[1], a[2], a[4], a[7]); }http://codepad.org/pTBSKRCu This program creates an integer array called a, which is of size 10. So, it has the capacity to store 10 integers. The values that we want to store are given inside curly braces, with commas separating them. Did you notice something weird about the output? a[1] should ideally be displaying the first value in the array, but it is displaying the second value. Well, that is because in C, the arrays start from the index 0. So the first value—that is, 1—gets stored ina[0] and not a[1]. We can do everything with array elements that we would usually do with variables. #include<stdio.h> void main() {     int a[5] = {1,4,3,2,2};     printf("%d \n", a[0]+a[1]);     printf("%d", a[4]+a[3]); }http://codepad.org/x24bmHWg Here's a simple program to add all the integers in an array and display the result: #include<stdio.h> void main() {    int a[3] = {1001, 2002, 3003};    printf("%d", a[0]+a[1]+a[2]); }http://codepad.org/4RMO1yPX Just like we have used an integer array, we can use float arrays and character arrays too. #include<stdio.h> void main() {     char first_name[4] = {'A','r','y','a'};     char last_name[5] = {'S','t','a','r','k'};     printf("Initials: %c.%c. \n", first_name[0], last_name[0]);     printf("First Name: %s \n", first_name); }http://codepad.org/5iipaqEn See the second printf? We have used %s to print a whole character array. This is what we call a string—as in, a string of characters. We can do lots of fun stuff with strings, which is something that we will cover later in this course. Tomorrow, we will learn about the most commonly used operators in C. Till then, keep coding!
Show less
No tags specified
Welcome back! Today's lesson will focus on commonly used operators that you will need for writing Cprograms. But before we do that, we are also going to get familiar with something called if statements. An if statement checks whether a particular condition is true and performs the corresponding action. Let us take an example: #include<stdio.h> void main() {     int a=5;     if (a>4)         printf("a is greater than 4"); }http://codepad.org/s8gh7YhE This program checks if the value of a is greater than 4, and if it is indeed greater than4, it will do whatever is written in the statement immediately afterward and before the next semicolon. You can read it as “if a is greater than 4, display 'a is greater than 4'”. See the > symbol? It is an operator. The equality symbol (=) is also an operator. Operators are symbols that tell your computer to perform a specific operation. For example, the + operator performs addition. List of common operators: < : less than <= : less than or equal to >= : greater than or equal to != : not equal to == : equality comparison The equality comparison operator (==) is used to compare two values, while the equality operator (=) is used to assign a value. Let me clarify with an example: #include<stdio.h> void main() {     int a=5;     if (a==5)         printf("a is equal to 5"); }http://codepad.org/1HLFcDO4 Note that when we write a=5 we are assigning the value 5 to the variable a, but when we write a==5, we are checking whether or not the value of a is equal to 5. A common mistake is when people write if(a=5) instead of if(a==5). What happens if you do this is the value 5 gets assigned to the variable a instead of checking whether or not the value of a is equal to 5, which ultimately leads to incorrect results. Other commonly used operators that you should know about are the logical AND and OR operators. The AND operator is specified by the symbol && and checks whether both the conditions specified are true, while the OR operator is specified by the symbol ||and checks if at least one of the conditions specified is true. Let's see an example: #include<stdio.h> void main() {     int a=5;     if(a>0 && a<10)         printf("This is a positive non-zero number less than 10"); }http://codepad.org/9uVBShRZ Now what happens if we need to do two different things based on whether or not a condition is satisfied? Well, C has got your back. Just use the else keyword. #include<stdio.h> void main() {     int a=5;     if(a==10)         printf("Number is equal to 10");     else         printf("Number is not equal to 10"); }http://codepad.org/a02qfnNZ You can make your program do more than one operation if it satisfies a condition. In such cases, you need to enclose all the statements within curly braces. #include<stdio.h> void main() {     int number1=10, number2=5;     if(number2!=0)     {         printf("%i \n", number1/number2);         printf("Division successful!");     }     else         printf("Cannot divide by zero!"); }http://codepad.org/hrdk5oFk That's all for today. Look out for tomorrow's email for the next lesson. Till then, keep practicing.
Show less
No tags specified
Hello! Welcome back to Getting Started with C Programming! Just a quick reminder: you are already halfway through the course. Yay you! When writing programs, sometimes we need to repeatedly perform the same operation. For example, you want your program to display the numbers from 1 to 100. One way to do that would be to use hundred printf statements. But you are coder, and you are going to use a loop statement. #include<stdio.h> void main() {     int number=1;     while (number<=10)     {         printf("%i \n", number);         number = number + 1;     } }http://codepad.org/zetRhVhe This is one of the simplest loop structures. The computer checks if the number is less than or equal to 10. If it satisfies this condition, the number is displayed, and then incremented by 1. This process continues until the number 10 is displayed. Since the statement for incrementing the number by 1 is present immediately after the display statement, the number becomes 11 and the while loop is again executed. This time, the condition is not satisfied, so we come out of the while loop and go to the next line. As we don't have any other statement after this, the program ends when it reaches the final closing curly bracket. Another commonly used loop structure is the for loop. #include<stdio.h> void main() {     int counter, number=10;     for(counter=1 ; counter<=10 ; counter=counter+1)         printf("%i \n", counter); }http://codepad.org/oCa This program does everything that the previous program did but is more compact. See the for statement. At first, the value 1 is assigned to the variable counter, followed by a semicolon to signal the end of value assignment. Then, the maximum value that counter is allowed to reach is specified. And finally, the last part increments counter by 1 for each iteration of the loop. The assignment of value to counter happens exactly once. Then the condition specified by the for statement is checked, and if the condition is satisfied, the computer performs the statements contained within the for loop—that is, in our case, display the value of counter. Next, the third and final part of the forstatement is performed; that is, counter is increased by 1, and the computer goes back to checking the condition specified by the second part of the for loop. This goes on until the condition is not satisfied, at which point we come out of the for loop and move to the next line in the program code. The for loop may seem slightly confusing at first, but once you get the hang of it, you will find yourself using it more than the while loop. See you tomorrow with more on loops. Till then, happy coding!
Show less
No tags specified
In today's lesson, we are going to learn how to use one if statement within another, and then follow it up with how to use one for looping within another for loop. There are certain cases where we need to check for multiple conditions, as we have already seen with the AND (&&) operator. However, sometimes, the conditions themselves depend on other conditions. In such cases, we use one if statement within another. Let's take an example. #include<stdio.h> void main() {     int age=24, income=1000;     if(age>=18)     {         if(income<5000)             printf("You are eligible to vote and are exempted from paying tax.");         else             printf("You are eligible to vote.");     }     else         printf("You are not eligible to vote."); }http://codepad.org/8Rh5laje The else on line number 9 is paired with the if in line number 7, and the else in line number 12 is paired with the if in line number 5. Similarly, we can use one for loop within another for loop. #include<stdio.h> void main() {     int column1, column2;     for(column1=1 ; column1<=5 ; column1=column1+1)     {         for(column2=1; column2<=4 ; column2=column2+1)         {             printf("%i %i \n",column1, column2);         }     } }http://codepad.org/kvDENIG5 See the output. At first, the value of column1 is assigned as 1, and now, the value ofcolumn2 changes from 1 to 4. Note that 4 is the maximum value that column2 is allowed to take. Now, column2 is again incremented and becomes 5. However, since column2 is not allowed to take a value of 5, the condition being checked by the second for is not satisfied. This makes us come out of the second for loop and go back to the first for loop. Here, the value of column1 is incremented by 1, and we move to the next statement. In this next statement, the value 1 is again assigned to column2, and the same process of incrementing the value of column2 while the value of column1 remains unchanged continues until the result 2 4 is displayed. After this, the value ofcolumn1 is incremented again by 1. This process continues until the result 5 4 is displayed. After 5 4 is displayed, the value of column2 is incremented by 1, but we know that column2 cannot be 5. So this condition is not satisfied, and we move back to the first for loop. Here, the value of column1 is incremented by 1, but sincecolumn1 cannot hold the value 6, we come out of this for loop as well and move to the next statement, which, in this program, is the closing curly brackets that end the program. The second for loop is inside the first for loop, so we call the second for loop theinner loop and the first for loop the outer loop. The two programs we saw today had just one level of nesting, but you will probably use more than one level of nested statements as you progress to comparatively more advanced programs.
Show less
No tags specified
In today's lesson, we will learn about functions. In a program, a function is a group of statements that perform a specific operation. So far, in each and every C program, we started with a void main(). If you look carefully, you'll notice that the statements contained within main()perform a specific operation. So, going by the definition of a function, main() is also a function. Notice the brackets next to main. Where else have you seen round brackets just next to a keyword? Yes, that's right! printf() is another such example. Well, printf() is a function as well. But there's a difference between main() and printf(). Can you guess what it is? We don't know what the statements that make up printf() are, but we do know what the statements within main() are. This is because the contents of printf()are stored within the stdio.h that we include in every program. It is what we call apre-defined function. You can create your own functions as well. These are called user-defined functions. Let us create a function that will find out the square of a number—that is, the number multiplied by itself. #include<stdio.h> void square(); void main() {     int num=5;     square(num); } void square(int num) {     int result;     result = num * num;     printf("The result is %i", result); }http://codepad.org/QLUCPxB7   The line void square(); tells the computer that we are about to work with a function called square(). We don't do this with the main(), but we need to write this line for every function that we build on our own; otherwise, the computer will not be able to recognize our function. The line square(num); means that we are sending the value of num to the functionsquare(). We write the contents of square() in a manner similar to the way we write the contents of main(). The int num inside the round brackets next to void squaremeans that square() has to accept an int (integer) value in the variable callednum. But we have already declared a variable called num in main(), you say. Why do we have to do this again? Well, that's because whatever you do inside main() stays inside main(). The moment you are outside main(), the values that you had worked with are lost, unless you specifically send a value to another function, which is, in our case, square(). So, the num variable has no existence outside main(). The num variable insquare() is a new variable that is being assigned the same value as the num ofmain(). You can use a different name for the num variable of square() and your program will work just as well: http://codepad.org/I7d4HIJ6. What square() does essentially is multiply the given number by itself and display the final answer using yet another function, which is printf(). So, we see that a function can call another function to do its bidding. In tomorrow's lesson, we will learn more about functions. Till then, happy coding!
Show less
No tags specified
Hey there! Yesterday's lesson was all about functions. Today, we are going to look at some important pre-defined functions like printf() that will really come in handy for your programs. Remember I told you that we need to include stdio.h if we want to useprintf()? Well, it is quite the same for other pre-defined functions too. For the next pre-defined function, we will need to include math.h. #include<stdio.h> #include<math.h> void main() {     int num = 25;     int result;     result = sqrt(num);     printf("%i",result); }http://codepad.org/EKkuGvev The pre-defined function here is sqrt(). The sqrt() finds out the square root of a number. We have to indicate the number whose square root we want to find within the round brackets. Another common pre-defined function is pow(). #include<stdio.h> #include<math.h> void main() {     int num = 10, power = 2;     int result;     result = pow(num, power);     printf("%i",result); }http://codepad.org/5je45P5U pow() finds out the result of a number raised to a given power. The number we use as a base is to be written first, followed by the power to which we want to raise it. For working with strings, we need to include string.h at the beginning of our program. #include<stdio.h> #include<string.h> void main() {     char word[5]={'h','a','p','p','y'};     int result;     result = strlen(word);     printf("%i", result); }http://codepad.org/yHCGc8W6 strlen() finds out the length of the string, which is the number of characters or alphabets in the string. In the above example, it might seem obvious that the length of the string is 5, because we have taken a character array of size 5. However, it is useful when you are working with a large character array that is storing a string of any size that is less than the array size. #include<stdio.h> #include<string.h> void main() {     char word[10]={'h','a','p','p','y'};     int result;     result = strlen(word);     printf("%i", result); }http://codepad.org/zZSrlqvn There are hundreds of pre-defined functions in C language that will aid you in simplifying the way you code. You don't have to reinvent the wheel—just use it. Some other .h files of interest to you are math.h and stdlib.h.
Show less
No tags specified
Congratulations! You made it to the end of the course. Yay you! Today's lesson will not talk about code the way we have so far. Instead, we are going to focus on how to continue with your coding journey even after the end of this course. The first thing that you should know is that these nine days have given you a very selective and controlled glimpse into the vast world of C programming. I have deliberately avoided the “tough” topics and tried to make this introductory course as easy as I could. This means that you will now be able to take further steps toward learning C with (hopefully) less apprehension, and you will find concepts easier to understand. However, the over-simplification of most concepts in this course also means that there is a lot more to learn, even about stuff that we have already covered in this course. The best way to learn coding is through coding. Yes, practice is the only way you will get a real handle on this language—or any other programming language, for that matter. For starters, play around with your code. Use the sample programs in this course and modify bits of them to better understand what is really going on. I recommend that you join a coding website such as Codechef, HackerRank, etc, where you can complete coding assignments of increasing complexity, as well as go back to that book that was scaring you. I promise it'll seem less scary now. If you plan to learn C further, it is advisable to get a C compiler right on your computer rather than rely on an online compiler. If you use Linux, you already have the gcc compiler on your computer and can get started straight away. For those of you who use Windows, some great compilers are DevC++ and TurboC++. Some really good resources are available online for learning C, but the best resource for you to go through at this point would be the book Let Us C by Yashwant Kanetkar. That's it, folks! I wish you a very happy journey into coding!
Show less
No tags specified
C programming language  https://www.amazon.com/gp/product/0131103628/ref=as_li_tl?ie=UTF8&camp=1789&creative=9325&creativeASIN=0131103628&linkCode=as2&tag=highbrow01-20&linkId=UKFKI55C7RM6XNGV   The authors present the complete guide to ANSI standard C language programming. Written by the developers of C, this new version helps readers keep up with the finalized ANSI standard for C while showing how to take advantage of C's rich set of operators, economy of expression, improved control flow, and data structures. The 2/E has been completely rewritten with additional examples and problem sets to clarify the implementation of difficult language constructs. For years, C programmers have let K&R guide them to building well-structured and efficient programs. Now this same help is available to those working with ANSI compilers. Includes detailed coverage of the C language plus the official C language reference manual for at-a-glance help with syntax notation, declarations, ANSI changes, scope rules, and the list goes on and on.   Programming in C https://www.amazon.com/Programming-Developers-Library-Stephen-Kochan-ebook/dp/B00MTUNHDQ/ref=mt_kindle?_encoding=UTF8&me=&qid= Programming in C will teach you how to write programs in the C programming language. Whether you’re a novice or experienced programmer, this book will provide you with a clear understanding of this language, which is the foundation for many object-oriented programming languages such as C++, Objective-C, C#, and Java. This book teaches C by example, with complete C programs used to illustrate each new concept along the way. Stephen Kochan provides step-by-step explanations for all C functions. You will learn both the language fundamentals and good programming practices. Exercises at the end of each chapter make the book ideally suited for classroom use or for self-instruction. All the features of the C language are covered in this book, including the latest additions added with the C11 standard. Appendixes provide a detailed summary of the language and the standard C library, both organized for quick reference. “Absolutely the best book for anyone starting out programming in C. This is an excellent introductory text with frequent examples and good text.…This is the book I used to learn C–it’s a great book.” –Vinit S. Carpenter, Learn C/C++ Today   C Primer Plus  https://www.amazon.com/gp/product/0321928423/ref=as_li_tl?ie=UTF8&camp=1789&creative=9325&creativeASIN=0321928423&linkCode=as2&tag=highbrow01-20&linkId=2KXLVHFZFAFWCWYT C Primer Plus is a carefully tested, well-crafted, and complete tutorial on a subject core to programmers and developers. This computer science classic teaches principles of programming, including structured code and top-down design. Author and educator Stephen Prata has created an introduction to C that is instructive, clear, and insightful. Fundamental programming concepts are explained along with details of the C language. Many short, practical examples illustrate just one or two concepts at a time, encouraging readers to master new topics by immediately putting them to use. Review questions and programming exercises at the end of each chapter bring out the most critical pieces of information and help readers understand and digest the most difficult concepts. A friendly and easy-to-use self-study guide, this book is appropriate for serious students of programming, as well as developers proficient in other languages with a desire to better understand the fundamentals of this core language. The sixth edition of this book has been updated and expanded to cover the latest developments in C as well as to take a detailed look at the new C11 standard. In C Primer Plus you’ll find depth, breadth, and a variety of teaching techniques and tools to enhance your learning: Complete, integrated discussion of both C language fundamentals and additional features Clear guidance about when and why to use different parts of the language Hands-on learning with concise and simple examples that develop your understanding of a concept or two at a time Hundreds of practical sample programs Review questions and programming exercises at the end of each chapter to test your understanding Coverage of generic C to give you the greatest flexibility   C Programming: A modern approach , 2nd edition  https://www.amazon.com/gp/product/0393979504/ref=as_li_tl?ie=UTF8&camp=1789&creative=9325&creativeASIN=0393979504&linkCode=as2&tag=highbrow01-20&linkId=KHOUHLIYRQGSMUL7   The first edition of C Programming: A Modern Approach was popular with students and faculty alike because of its clarity and comprehensiveness as well as its trademark Q&A sections. Professor King's spiral approach made it accessible to a broad range of readers, from beginners to more advanced students. With adoptions at over 225 colleges, the first edition was one of the leading C textbooks of the last ten years. The second edition maintains all the book's popular features and brings it up to date with coverage of the C99 standard. The new edition also adds a significant number of exercises and longer programming projects, and includes extensive revisions and updates.     A book on C: Programming in C https://www.amazon.com/gp/product/0201183994/ref=as_li_tl?ie=UTF8&camp=1789&creative=9325&creativeASIN=0201183994&linkCode=as2&tag=highbrow01-20&linkId=B34ZS5UKB66SEVZG   Now in its fourth edition, A Book on C retains the features that have made it a proven, best-selling tutorial and reference on the ANSI C programming language. This edition builds on the many existing strengths of the text to improve, update, and extend the coverage of C, and now includes information on transitioning to Java and C++ from C.Beginners and professional programmers alike will benefit from the numerous examples and extensive exercises developed to guide readers through each concept. Step-by-step dissections of program code illuminate the correct usage and syntax of C language constructs and reveal the underlying logic of their application. The clarity of exposition and format of the book make it an excellent reference on all aspects of C.Highlights of A Book on C, Fourth Edition: New and updated programming examples and dissections-the authors' trademark technique for illustrating and teaching language concepts.Recursion is emphasized with revised coverage in both the text and exercises. Multifile programming is given greater attention, as are the issues of correctness and type safety. Function prototypes are now used throughout the text.Abstract Data Types, the key concept necessary to understanding objects, are carefully covered.Updated material on transitioning to C++, including coverage of the important concepts of object-oriented programming.New coverage is provided on transitioning from C to Java.References to key programming functions and C features are provided in convenient tables.   Pratical C programming : Why does 2 + 2 = 5986? https://www.amazon.com/gp/product/1565923065/ref=as_li_tl?ie=UTF8&camp=1789&creative=9325&creativeASIN=1565923065&linkCode=as2&tag=highbrow01-20&linkId=S4OOCS3PRBH4Y4W3 There are lots of introductory C books, but this is the first one that has the no-nonsense, practical approach that has made Nutshell Handbooks® famous.C programming is more than just getting the syntax right. Style and debugging also play a tremendous part in creating programs that run well and are easy to maintain. This book teaches you not only the mechanics of programming, but also describes how to create programs that are easy to read, debug, and update.Practical rules are stressed. For example, there are fifteen precedence rules in C (&& comes before || comes before ?:). The practical programmer reduces these to two: Multiplication and division come before addition and subtraction. Contrary to popular belief, most programmers do not spend most of their time creating code. Most of their time is spent modifying someone else's code. This books shows you how to avoid the all-too-common obfuscated uses of C (and also to recognize these uses when you encounter them in existing programs) and thereby to leave code that the programmer responsible for maintenance does not have to struggle with. Electronic Archaeology, the art of going through someone else's code, is described.This third edition introduces popular Integrated Development Environments on Windows systems, as well as UNIX programming utilities, and features a large statistics-generating program to pull together the concepts and features in the language.   Head First C: A brain-friendly guide https://www.amazon.com/gp/product/1449399916/ref=as_li_tl?ie=UTF8&camp=1789&creative=9325&creativeASIN=1449399916&linkCode=as2&tag=highbrow01-20&linkId=MB2LZA3O5AUNI3EZ Ever wished there was an easier way to learn C from a book? Head First C is a complete learning experience that will show you how to create programs in the C language. This book helps you learn the C language with a unique method that goes beyond syntax and how-to manuals and helps you understand how to be a great programmer. You'll learn key areas such as language basics, pointers and pointer arithmetic, and dynamic memory management, and with advanced topics such as multi-threading and network programming, Head First C can be used as an accessible text book for a college-level course. Also, like a college course, the book features labs: projects intended to stretch your abilities, test your new skills, and build confidence. You'll go beyond the basics of the language and learn how to use the compiler, the make tool and the archiver to tackle real-world problems. We think your time is too valuable to waste struggling with new concepts. Using the latest research in cognitive science and learning theory to craft a multi-sensory learning experience, Head First C uses a visually rich format designed for the way your brain works, not a text-heavy approach that puts you to sleep.   C pocket reference  https://www.amazon.com/gp/product/0596004362/ref=as_li_tl?ie=UTF8&camp=1789&creative=9325&creativeASIN=0596004362&linkCode=as2&tag=highbrow01-20&linkId=CCO37XTJTEJG42SV C is one of the oldest programming languages and still one of the most widely used. Whether you're an experienced C programmer or you're new to the language, you know how frustrating it can be to hunt through hundreds of pages in your reference books to find that bit of information on a certain function, type or other syntax element. Or even worse, you may not have your books with you. Your answer is the C Pocket Reference. Concise and easy to use, this handy pocket guide to C is a must-have quick reference for any C programmer. It's the only C reference that fits in your pocket and is an excellent companion to O'Reilly's other C books.Ideal as an introduction for beginners and a quick reference for advanced programmers, the C Pocket Reference consists of two parts: a compact description of the C language and a thematically structured reference to the standard library. The representation of the language is based on the ANSI standard and includes extensions introduced in 1999. An index is included to help you quickly find the information you need.This small book covers the following: C language fundamentals Data types Expressions and operators C statements Declarations Functions Preprocessor directives The standard library O'Reilly's Pocket References have become a favorite among programmers everywhere. By providing a wealth of important details in a concise, well-organized format, these handy books deliver just what you need to complete the task at hand. When you've reached a sticking point in your work and need to get to a solution quickly, the new C Pocket Reference is the book you'll want to have.   Let us C https://www.amazon.com/gp/product/8183331637/ref=as_li_tl?ie=UTF8&camp=1789&creative=9325&creativeASIN=8183331637&linkCode=as2&tag=highbrow01-20&linkId=OOAH4EYYTK46THGW Let Us C is a popular introductory book to the world of C programming. Its simple and approachable style has kept it a popular resource for newbies for many years. Summary of The Book With the expanding horizon of digital technology, there is also an increasing need for software professionals with a good command of a variety of programming languages. The C language is one of the basic skill sets in a programmers portfolio. There has been an explosion in the number of programming languages and different development platforms. However, the C programming language has retained its popularity across the decades. Let Us C is a great resource from which one can learn C programming. It does not assume any previous knowledge of C or even the basics of programming. It covers everything from basic programming concepts and fundamental C programming constructs. The book explains basic concepts like data types and control structures, decision control structure and loops, creating functions and using the standard C library. It also covers C preprocessor directives, handling strings, and error handling. It also discusses C programming under different environments like Windows and Linux. The book uses a lot of programming examples to help the reader gain a deeper understanding of the various C features. This book also aims to help prepare readers not just for the theoretical exams, but also the practical ones. It builds their C programming skills. It also helps in getting through job interviews. There is a separate section in the book that discusses the most Frequently Asked Questions in job interviews. This is the 13th edition of the book and it covers all levels of C programming, from basic to intermediate and advanced levels of expertise. With clear concept coverage, simple instructions and many illustrative examples, Let Us C teaches programming and C language features effectively and easily. Getting Started Ø C Instructions Ø Decision Control Instruction Ø More Complex Decision Making Ø Loop Control Instruction Ø More Complex Repetitions Ø Case Control Instruction Ø Functions Ø Pointers Ø Recursion Ø Data Types Revisited Ø The C Preprocessor Ø Arrays Ø Multidimensional Arrays Ø Strings Ø Handling Multiple Strings Ø Structures Ø Console Input/ Output Ø File Input/ Output Ø More Issues in Input/ Output Ø Operations on Bits Ø Miscellaneous Features Ø C Under Linux Ø Interview FAQ s Ø C Language Programmers Instant Reference Card Ø Appendix A- Compilation and Execution Ø Appendix B- Precedence table Ø Appendix C-Chasing the Bugs Ø Appendix D- ACII Chart Ø Periodic Tests I to IV Ø Index
Show less
Show full summary Hide full summary