C language Programming: Simple, Short, and Straightforward Way of Learning C Programming
3.5/5
()
About this ebook
This book is for absolute beginners with or without prior knowledge in programming, as this book uses Simple words, Short sentences, and Straightforward paragraphs. The triple S way of learning C language programming. The topics covered in this book includes brief introduction to C language, variables, data types, control structures, functions, pointers, and input and output stream to external files. This book starts its discussion from short history to installation of the needed software resource and a step by step screen shots of how to write C language code, compile and execute C programs. It presents graphical representation of algorithms for simpler learning. This book is packed with working and running C program samples and after reading this book, the reader would be able to develop and create C language programs based particularly from problems given in computer science courses, hence, adopting to other programming language will be a lot easier. This book is your first step in your programming career.
Sherwyn Allibang
Sherwyn Allibang has 10 years experience in the academe as college professor handling business and IT related subjects. Aside from his career as an academe, he is also a freelance software developer catering system development from project management to core programming. With the degree in Bachelor of Science in Information Technology, Master in Business Administration, Master in Information Technology, and Doctor in Business Administration, Sherwyn is a solutions-focused, team oriented IT Specialist, with broad-based experience and hands-on skill in the successful implementation of highly effective technical support strategies. A proven ability to successfully analyze an organization's critical support requirements, identifies deficiencies and potential opportunities, and develops innovative solutions for increasing reliability and improving productivity.
Read more from Sherwyn Allibang
Methods of Research: Simple, Short, And Straightforward Way Of Learning Methods Of Research Rating: 4 out of 5 stars4/5Assembly Programming:Simple, Short, And Straightforward Way Of Learning Assembly Language Rating: 5 out of 5 stars5/5C++ Programming Language: Simple, Short, and Straightforward Way of Learning C++ Programming Rating: 4 out of 5 stars4/5
Related to C language Programming
Related ebooks
Computer Programming In C Language Rating: 4 out of 5 stars4/5C Programming for Beginners: Your Guide to Easily Learn C Programming In 7 Days Rating: 4 out of 5 stars4/5C Programming Concepts Rating: 0 out of 5 stars0 ratingsC Programming Language, A Step By Step Beginner's Guide To Learn C Programming In 7 Days. Rating: 4 out of 5 stars4/5C Programming Language Rating: 4 out of 5 stars4/5Learn C Programming in 24 Hours Rating: 0 out of 5 stars0 ratingsComputer Programming Using C Rating: 0 out of 5 stars0 ratingsTeach Yourself C++ Rating: 4 out of 5 stars4/5C Programming For Beginners: The Simple Guide to Learning C Programming Language Fast! Rating: 5 out of 5 stars5/5Programming Concepts in C++ Rating: 0 out of 5 stars0 ratingsUpdate to Modern C++ Rating: 0 out of 5 stars0 ratingsC Programming: C Programming Language for beginners, teaching you how to learn to code in C fast! Rating: 0 out of 5 stars0 ratingsProgramming Problems: A Primer for The Technical Interview Rating: 4 out of 5 stars4/5C++ Learn in 24 Hours Rating: 0 out of 5 stars0 ratingsC# Programming from Zero to Proficiency (Introduction): C# from Zero to Proficiency, #0 Rating: 0 out of 5 stars0 ratingsPYTHON: Practical Python Programming For Beginners & Experts With Hands-on Project Rating: 5 out of 5 stars5/5C# Programming Rating: 5 out of 5 stars5/5Mastering C# 8.0: Master C# Skills with Hands-on Code Examples (English Edition) Rating: 0 out of 5 stars0 ratingsComputer Programming Languages for Beginners Rating: 0 out of 5 stars0 ratingsC# Programming Fundamentals Rating: 0 out of 5 stars0 ratingsProgramming Problems: Advanced Algorithms Rating: 4 out of 5 stars4/5Programming In ‘C’ Rating: 0 out of 5 stars0 ratingsIntroduction to Programming Languages Rating: 4 out of 5 stars4/5Mastering C# and .NET Framework Rating: 5 out of 5 stars5/5Programming in C | Step by Step: The Simple Beginner's Guide Rating: 0 out of 5 stars0 ratingsProfound Python Rating: 5 out of 5 stars5/5Computer Practices Using C++ Rating: 0 out of 5 stars0 ratings
Programming For You
Coding All-in-One For Dummies Rating: 4 out of 5 stars4/5Learn to Code. Get a Job. The Ultimate Guide to Learning and Getting Hired as a Developer. Rating: 5 out of 5 stars5/5Python Programming : How to Code Python Fast In Just 24 Hours With 7 Simple Steps Rating: 4 out of 5 stars4/5Python: Learn Python in 24 Hours Rating: 4 out of 5 stars4/5SQL QuickStart Guide: The Simplified Beginner's Guide to Managing, Analyzing, and Manipulating Data With SQL Rating: 4 out of 5 stars4/5Excel 101: A Beginner's & Intermediate's Guide for Mastering the Quintessence of Microsoft Excel (2010-2019 & 365) in no time! Rating: 0 out of 5 stars0 ratingsSQL All-in-One For Dummies Rating: 3 out of 5 stars3/5Excel : The Ultimate Comprehensive Step-By-Step Guide to the Basics of Excel Programming: 1 Rating: 5 out of 5 stars5/5Coding All-in-One For Dummies Rating: 0 out of 5 stars0 ratingsHTML in 30 Pages Rating: 5 out of 5 stars5/5Linux: Learn in 24 Hours Rating: 5 out of 5 stars5/5Python Machine Learning By Example Rating: 4 out of 5 stars4/5Python: For Beginners A Crash Course Guide To Learn Python in 1 Week Rating: 4 out of 5 stars4/5Learn SQL in 24 Hours Rating: 5 out of 5 stars5/5Python Data Structures and Algorithms Rating: 5 out of 5 stars5/5Coding with JavaScript For Dummies Rating: 0 out of 5 stars0 ratingsLearn PowerShell in a Month of Lunches, Fourth Edition: Covers Windows, Linux, and macOS Rating: 5 out of 5 stars5/5A Slackers Guide to Coding with Python: Ultimate Beginners Guide to Learning Python Quick Rating: 0 out of 5 stars0 ratingsJavaScript All-in-One For Dummies Rating: 5 out of 5 stars5/5
Reviews for C language Programming
3 ratings2 reviews
- Rating: 4 out of 5 stars4/5
May 14, 2019
Good overview of C language, Pointers and arrays could've been elaborated bit more. - Rating: 5 out of 5 stars5/5
Apr 11, 2021
great read; helped indicate format coding
great for reference as well
Book preview
C language Programming - Sherwyn Allibang
C language Programming: Simple, Short, and Straightforward Way of Learning C Programming
Copyright 2016
Sherwyn Allibang
Edition License Notes
This book is authorized for your own personal use. This book may not be re-sold or offered away to other individuals. Much thanks to you for regarding the diligent work of the author.
Introduction
This book is for absolute beginners with or without prior knowledge in programming, as this book uses Simple words, Short sentences, and Straightforward paragraphs. The triple S way of learning C language programming. The topics covered in this book includes brief introduction to C language, variables, data types, control structures, functions, pointers, and input and output stream to external files. This book starts its discussion from short history to installation of the needed software resource and a step by step screen shots of how to write C language code, compile and execute C programs. It presents graphical representation of algorithms for simpler learning. This book is packed with working and running C program samples and after reading this book, the reader would be able to develop and create C language programs based particularly from problems given in computer science courses, hence, adopting to other programming language will be a lot easier. This book is your first step in your programming career.
TO GOD BE ALL THE GLORY!
The resources used in this book are:
> Personal Computer running Windows 7 Operating System
> Dev-C++ available at http://bloodshed.net
Other Windows OS versions can also be used as long as it supports the above mentioned software. You may also ought to use other C compilers or IDE. Moreover, the sample programs and codes also work with Linux Operating Systems.
NOTE: All links provided in this book are updated occasionally. If a link becomes unavailable, email me at zherwyndbest@facebook.com
Table of Contents
Acknowledgement
Dedication
Chapter 1 - Starting C Language Programming
Short history of C Language
Reasons to use C Language
Beginning to Program in C Language
Installing the Dev-C++
Installing compiler for Linux
Self-assessment questions
Chapter 2 - Our First C Language Program
Definition of programming terms
The components of a C program
Writing, compiling, and running our first program using Dev-C++ for Windows
Correcting errors
Writing, compiling, and running our first program with Linux
Statements
Null Statements
White spaces
Self-assessment questions
Chapter 3 - Storing Data: Variables and Data Types in C Language
Variable
Variable Declaration and definition
Scope of variables
Constants
Keywords
Conversion specifiers of data types
Self-assessment questions
Chapter 4 - Fundamentals of Input And Output in C Language
Displaying text on-screen
puts() function
printf() function
Literal text
An escape sequence
Accepting user input
getch() function
getche() and getchar() functions
scanf() function
gets() function
Self-assessment questions
Chapter 5 - Arrays and Strings in C Language
What is an Array?
Single-Dimensional
Multi-Dimensional Array
Strings
Declaring and defining a string
Defining a string using input functions
Strings' pre-defined functions
Length of a String
Concatenation of Strings
Compare Two Strings
Copy Strings
Reversing the Order of a String
Converting Uppercase Strings to Lowercase Strings
Converting Lowercase Strings to Uppercase Strings
Self-assessment questions
Chapter 6 - Mathematical Operations in C Language
Expressions
Operators
Assignment Operator
Mathematical Operators
Binary
Unary
Mathematical operators precedence level and parentheses
Relational Operators
Logical Operators
Type Casting
Pre-defined Mathematical Functions
acos()
asin()
atan()
atan2()
cos()
cosh()
sin()
sinh()
tan()
tanh()
exp()
log()
log10()
pow()
sqrt()
ceil()
fabs()
floor()
fmod()
Self-assessment questions
Chapter 7 - Conditional Statements in C language
The if() statement
Single-alternative
Dual-alternative
Multiple-alternative
Nested if() statement
The switch() statement
Things to consider in conditional statement
Self-assessment questions
Chapter 8 - Looping Statements in C Language
What is a Loop?
Counter-controlled loop
for() loop statement
Nested for() loop statement
Condition-controlled loop
Pre-test loop
Post-test loop
The Infinite Loop
Self-assessment questions
Chapter 9 - User-Defined Functions in C Language
User-defined function
User-defined function prototype
User-defined function definition
Calling a user-defined function
Things to consider in functions:
Self-assessment questions
Chapter 10 - User-Defined Data Types in C Language
Structures
Declaring a structure
Defining a structure
Accessing Structure Members
Compound declaration and definition of structure
Self-assessment questions
Chapter 11 - Pointer in C Language
Pointers in C language
Pointer Declaration and definition
How pointers works?
Pointer Arithmetic
Self-assessment questions
Chapter 12 - File Management in C Language
File management in C
Defining and opening a file
Closing a File
Reading and writing a file
putc() and getc() functions
fprintf() and fscanf() functions
Deleting a File
Renaming a File
Self-assessment questions
Answers to self-assessment questions
Ending Notes
Disclaimer
About the Author
Acknowledgements
The author wishes to express his heartfelt gratitude to the Almighty God for His grace, wisdom, and guidance and for giving the author the determination to write this book. This book would not have been possible without the support and help of several individuals who in one way or another contributed and extended their valuable assistance in the preparation and completion of this material. The author offer his regards and blessings to all of those who supported him in any respect during the completion of this book.
Dedication
The author dedicates this book to the ALMIGHTY GOD.
This book is also dedicated to Dennis Ritchie for giving the author the tools to program and to Bill Gates for giving the author the reasons to program.
Chapter 1 - Starting C Language Programming
This chapter presents a brief overview of C language. It presents the things needed in starting C language programming.
Short history of C Language
C is a general-purpose high level language that was originally developed by Dennis Ritchie for the Unix operating system. It was first implemented on the Digital Equipment Corporation PDP-11 computer in 1972. The Unix operating system and virtually all Unix applications are written in the C language. C has now become a widely used professional language for various reasons:
1. Easy to learn.
2. Structured language.
3. Produces efficient programs.
4. It can handle low-level activities.
5. It can be compiled on a variety of computers.
6. It has a low-level language capability with the convenience of high-level programming.
C language was invented to write an operating system called UNIX. C is a successor of B language which was introduced around 1970. The language was formalized in 1988 by the American National Standard Institute (ANSI). By 1973 UNIX OS almost totally written in C. Today C is the most widely used System Programming Language. Most of the state of the art software have been implemented using C language.
Reasons to use C Language
To start with, I highly recommend C language for any beginning programmers to start their programming career because most of the high-level and other popular programming languages today is based from C language. Once you've learned the concepts behind programming language with C, adopting or migrating to other language will be easy as most of the things needed are pretty similar.
C was initially used for system development work, in particular the programs that make-up the operating system. C was adopted as a system development language because it produces code that runs nearly as fast as code written in assembly language. Some examples of the use of C might be:
1. Operating Systems
2. Language Compilers
3. Assemblers
4. Text Editors
4. Print Spoolers
5. Network Drivers
6. Modern Programs
7. Data Bases
8. Language Interpreters
9. Utilities
10. C Program File
Beginning to Program in C Language
All the C programs are written into text files with extension .c
for example hello.c
, where .c
is extension file name. These text files are called source files. The source files contains the C source codes and will later be transformed into a running executable file. The program development cycle of C language are:
1. Write the source codes into a text editor (ex: notepad) to create the source file.
2. Compile the source file to create the object file.
3. The object file is link into an executable (ex: .exe for windows) file.
4. Run the program and see the result.
Based from the program development cycle of C, notice that there are several things needed which includes a text editor, a compiler, and a linker. The good news is that, for Windows users, there is a software that comprises the three. It is called Dev-C++ which is available at http://bloodshed.net and for the download direct link at http://bloodshed-dev-c.en.softonic.com/download.
Dev-C++ is a C source code editor, a compiler, and a linker. All the things needed in creating a C program.
Note: You may ought to use other C compilers.
Installing the