Skip to content

What is a Program

Using programming language we will write program for the computer.
Program
it is a set of instructions or step by step guidance given to computer to complete a given task.
Software
collection of programs working together to provide an user interface with options for a specific purpose.
>>>Diagram
End-User
who wants to use computer in day to day life, by learning options in the software.
Programmer
who is writing programs using programming lang.
Developer (Software Engineer)
who is developing Software by using many Development techniques including Programming.
>>>History of C Language:
C Language is developed by Dennis Ritchie in 1972 in AT&T Bell Laborities.
Features of c lang:
1. it is high level programming lang.
2. portable or hardware platform independent.
3. middle level language.
Hardware Platform:
Configuration: processor, RAM, Motheboard
Software Platform:
Operating System (O/s) Eg: Windows, Linux, Mac etc
Being a high level language, C Lang is providing some of the features of low level languages like pointers, dynamic memory manipulation etc.  That’s why C is called as Middle Level language.
C Lang is used to re-write source code of Unix Operating system.
>>>Minimum C Program:
#include<stdio.h>
void main()
{
…..
…..
}
(OR)
#include<stdio.h>
int main()
{
…..
…..
return 0;
}
>>>Common Parts of C Program:
1. statements
2. comments.
3. functions
statement
it is a line of code or executable instruction that is terminated with semicolon
Types of Program Statements:
1. declaration statements
2. assignment statement
3. output statement
4. input statements
5. pre-processor statements
pre processor statements
these are special instructions to the compiler and appear at the top of the C program.  These start with # symbol and ends the current line.
Example:
#include<stdio.h>
#define MAX 100
Compound statement or block
group of statements enclosed between two curly braces.
you can also put a single statement between a pair of curly braces but it is optional.
>>>comments
these are used to provide description for different sections of the code for future reference.  These are completely ignored by compiler and won’t get converted into machine code.
Comments can only be seen in source code and useful to the programmer.

2 styles of comments:
1. single line: starts with // sign and ends with current line
2. multi line: starts with /* and ends with */
Add comment style in Code Blocks: Ctrl+Shift+C
Remove comment style in Code Blocks: Ctrl+Shift+X