w3resource

C Programming Exercises, Practice, Solution

What is C Programming Language?

C is a general-purpose, imperative computer programming language, supporting structured programming, lexical variable scope and recursion, while a static type system prevents many unintended operations.

C was originally developed by Dennis Ritchie between 1969 and 1973 at Bell Labs, and used to re-implement the Unix operating system. It has since become one of the most widely used programming languages of all time, with C compilers from various vendors available for the majority of existing computer architectures and operating systems.

The best way we learn anything is by practice and exercise questions. We have started this section for those (beginner to intermediate) who are familiar with C programming.

Hope, these exercises help you to improve your C programming coding skills. Currently, following sections are available, we are working hard to add more exercises .... Happy Coding!

List of C Programming Exercises :

[ Want to contribute to C exercises? Send your code (attached with a .zip file) to us at w3resource[at]yahoo[dot]com. Please avoid copyrighted materials.]

Do not submit any solution of the above exercises at here, if you want to contribute go to the appropriate exercise page.

Popularity of Programming Language
Worldwide, Jan 2022 compared to a year ago:

`
Rank Change Language Share Trend
1 Python 28.74 % -1.8 %
2 Java 18.01 % +1.2 %
3 Javascript 9.07 % +0.6 %
4 up arrow C/C++ 7.4 % +1.1%
5 down arrow C# 7.27 % +0.7 %
6 PHP 6.06 % +0.0 %
7 R 4.19 % +0.3 %
8 Objective-C 2.27 % -1.4 %
9 Swift 1.91 % -0.2 %
10 TypeScript 1.74 % -0.0 %
11 Matlab1.74% +0.0 %
12 Kotlin 1.71 % +0.0 %
13 Go 1.19 % -0.1 %
14 VBA 1.14 % -0.0 %
15 Ruby 1.07 % -0.0%
16 Rust 0.98 % -0.0 %
17 up arrow Ada 0.75 % +0.1 %
18 up arrow Dart 0.72 % +0.2 %
19 up arrow Abap 0.66 % +0.2 %
20 down arrow Visual Basic 0.64 % -0.0 %
21 down arrow Scala 0.48 % -0.2%
22 up arrow Groovy 0.48 % +0.1 %
23 down arrow Lua 0.42 % -0.2 %
24 down arrow Perl 0.38 % -0.1 %
25 up arrow Haskell 0.34 % +0.1 %
26 down arrow Julia 0.34 % -0.0 %
27 down arrow Cobol 0.3 % -0.0 %

Source : https://pypl.github.io/PYPL.html

TIOBE Index for January 2022

Jan 2022 Jan 2021 Change Programming Language Ratings Change
1 3 up arrow Python 13.58% +1.86%
2 1 down arrow C 12.44% -4.94%
3 2 down arrow Java 10.66% -1.30%
4 4 C++ 8.29% +0.73%
5 5 C# 5.68% +1.73%
6 6 Visual Basic 4.74% +0.90%
7 7 JavaScript 2.09% -0.11%
8 11 up arrow Assembly language 1.85% +0.21%
9 12 up arrow SQL 1.80% +0.19%
10 13 up arrow Swift 1.41% -0.02%
11 8 down arrow PHP 1.40% -0.60%
12 9 down arrow R 1.25% -0.65%
13 14 up arrow Go 1.04% -0.37%
14 19 up arrow Delphi/Object Pascal 0.99% +0.20%
15 20 up arrow Classic Visual Basic 0.98% +0.19%
16 16 MATLAB 0.96% -0.19%
17 10 down arrow Groovy 0.94% -0.90%
18 15 down arrow Ruby 0.88% -0.43%
19 30 up arrow Fortran 0.77% +0.31%
20 17 down arrow Perl 0.71% -0.31%

Source : https://www.tiobe.com/tiobe-index/

List of Exercises with Solutions :



C Programming: Tips of the Day

How to compile and run C/C++ in a Unix console/Mac terminal?

If it is a simple single source program:

make foo

where the source file is foo.c or foo.cpp, etc.

You dont even need a makefile. Make has enough built-in rules to build your source file into an executable of the same name, minus extension.

Running the executable just built is the same as running any program - but you will most often need to specify the path to the executable as the shell will only search what is in $PATH to find executables, and most often that does not include the current directory (.).

So to run the built executable foo:

./foo

Ref : https://bit.ly/3ebOLB7