0% found this document useful (0 votes)
174 views

C Programming Notes

The document discusses the basics of computer programming in C including the history of computers, components of a C program, data types, operators, control structures, functions, and algorithms for basic math operations like addition, subtraction, multiplication, and division. It provides examples of the structure of a simple C program and the steps to write algorithms to solve problems involving numeric calculations.

Uploaded by

Vimal Nakum
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
174 views

C Programming Notes

The document discusses the basics of computer programming in C including the history of computers, components of a C program, data types, operators, control structures, functions, and algorithms for basic math operations like addition, subtraction, multiplication, and division. It provides examples of the structure of a simple C program and the steps to write algorithms to solve problems involving numeric calculations.

Uploaded by

Vimal Nakum
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
You are on page 1/ 3

Computer: Elctronics device which perform the following Task:

1. Arithmetic Operation: +,-,/,*,%


2. Logical Opeation: <,>,<=,>=,==,!=

Computer Generation:
1st Generation: 1946 Digital Computer
2nd Generation: 1955 Vacuum Based
3rd Generation: 1965 IC (Integrated Circuit) Based
4th Generation: 1974 Micro IC Based
5th Generation : 1984 to till now: Artifical Intelligent

Computer Programming:
1. Low Level Language:Machine Laguage base binary: 0 and 1

2. Middle Level Language: Assembly Language base of maths add, sub, div, mul Ex.
COBOL , BASIC, FORTRON,

3. High Level Language: Simple english sentences Easy to learn


Ex. C, C++, Core Java, .net, Perl, C#, DS, DBMS, R Studio, Python

Complier: HLL to transfer in M/c Language. Whole code Convert

Interprter: HLL to transfer in M/c Language. Line by line code Convert

C Prgramming Languge: 1972 Devloped by Denis Ritchie in Bell leboratory.

Structure of C Programming:
1. Include Header file
2. main function()
3. Declare Variable
4. Programming Statment (Logical)
{ Statement 1, statement 2..statment n }
5. Output

Syntax Programme:
#include<stdio.h> 1. standard input and output header file
#include<conio.h> console input and output header file
void main() 2.
{
Declare the variable a,b,c,d,e 3
Programming Logic: (Statement 1, 2,3,...n)

Compile the c Prgramme: Alt+ f9


Run the c Prgramme: ctrl+ f9
IDE : Integrated Development Environment: Turboc++
Online : https://www.onlinegdb.com/online_c_compiler

// First Progrmme
#include<stdio.h> // include header file: standard input and output header file
int main() // main is function
{ // starting the function
printf("Hello world"); //statement1 print
return 0; // return the value

}
// closeing of function
Rules of writing of C Programming:
1. All keywords are lowere case
2. c is case sesitive language.
3. dont use keywords like as for, if, else, while, do while, exit, continue..
4. give the comment a. // single line b. /* Multiline comment */
5. main() is always the first fucntion called when programme excution.

ALGORITHMS: It is sequence of precise instruction for solve a problem in a


particular task.
ex. Q1. write the algorithm of Addition of two numbers

step 1: start
step 2: input three variable
step 3: declare variable a,b,c
step 4: Logic: c=(a+b);
step 5: print "Addition of two numbers:" c
step 6: stop

ex. Q2. write the algorithm of multipilication of two numbers

step 1: start
step 2: input three variable
step 3: declare variable a,b,c
step 4: Logic: c=(a*b);
step 5: print "Multiplicaiton of two numbers:" c
step 6: stop

ex. Q3. write the algorithm of subtraciton of two numbers

step 1: start
step 2: input three variable
step 3: declare variable a,b,c
step 4: Logic: c=(a-b);
step 5: print subtraction of two numbers:" c
step 6: stop

ex. Q4. write the algorithm of division of two numbers

step 1: start
step 2: input three variable
step 3: declare variable a,b,c
step 4: Logic: c=(a/b);
step 5: print "Divsion of two numbers:" c
step 6: stop

ex. Q5. write the algorithm of multipilication of three numbers

step 1: start
step 2: input four variable
step 3: declare variable a,b,c,d
step 4: Logic: d=(a*b*c);
step 5: print "Multiplicaiton of three numbers:" d
step 6: stop

ex. Q6. write the algorithm of Average of 5 numbers

step 1: start
step 2: input six variable
step 3: declare variable a,b,c,d,e,avg
step 4: Logic: avg=(a+b+c+d+e)/5;
step 5: print "Average of numbers:" avg
step 6: stop

You might also like