3. What is c programming?
C has now become a widely used professional language for various reasons:
Easy to learn.
Structured language.
It produces efficient programs .
It can handle low-level activities.
It can be compiled on a variety of computer platforms.
4. Importance of Programming & Problem
Solving
• Here are some of the things that learning coding can empower someone to do-
• To Make someone’s Own Website.
• Become a Career Coder.
• Start a Business
• Some of the kinds of businesses you can start include…
selling software
selling mobile apps
e-commerce
selling your coding time.
To Understand How Computers Work and so more.
6. HEADER FILE
• A header file is a file with extension .h which contains C function declarations .
• There are two types of header files :
Files that the programmer writes and
Files that comes with a compiler.
• For Example:
stdio.h header file contains standard Input and Output functions.
string.h header file contains string handling functions.
7. Main function
• main() function is the entry point of any C program;
• It is the point at which execution of program is started;
• When a C program is executed, the execution control goes directly to the
main() function.
• Every C program have a main() function.
• It’s a compulsory for c program.
12. Comments in c
• A comment is a programmer-readable explanation;
• They are added with the purpose of making the source code easier for humans to understand,
and are generally ignored by compilers and interpreters.
• Example-
• Single line comment-
//(double slash);
Multiline comment-
/*---------
------*/
• This can span over to multiple line;
14. variables
• Variables are data that will keep on changing. A variable is nothing but a name given to a
storage area that our programs can manipulate.
• Declaration
<<Data type>> <<variable name>>;
int a;
• Definition
<<varname>>=<<value>>;
a=10;
• Usage
<<varname>> I
a=a+1; //increments the value of a by 1
17. Constants
• Constants refer to fixed values that the program may not alter during its
execution. These fixed values are also called literals.
• Given below is the form to use #define preprocessor to define a
• constant −
• #define identifier value
18.
19. Input Output
INPUT
-scanf(“%d”,&a);
-gets an integer value from the user and stores it under the name ‘a’
Output
-printf (“%d”,a);
-print the value present in variable a on the screen