C PROGRAMMING- LANGUAGE
Now a day computer education is important part of our life. Computer is used in every field of life like Banking, Education , E-commerce, Internet etc,
C LANGUAGE - C PROGRAMMING
Before starting c programming or c language lets understand what is the software and use ..
Software is a collection of program or procedure to perform a particular task. And a program is a collection of instruction. To develop any software their is requirement of SDLC PROCESS called a Software Development Life Cycle. Their are different phase in SDLC PROCESS
Software is a collection of program or procedure to perform a particular task. And a program is a collection of instruction. To develop any software their is requirement of SDLC PROCESS called a Software Development Life Cycle. Their are different phase in SDLC PROCESS
SOFTWARE DEVELOPMENT LIFE CYCLE DIGRAM
1-REQUIREMENT
First
We find what is the requirement of of user. what software or project
he/she want to develop. what is his organization requirement.. what is
the basic purpose of project. The requirement give the idea to the developer.
2-ANALYSIS
After
requirement phase the developer analyze how can develop the software or
project.. what kind of language or tool is required and how to make the database
according to project. The developer ask question from user or search on
internet according to requirement.
3-DESIGN
After analyzing project we will start the design part. because it is the one of most important part of SOFTWARE DEVELOPMENT LIFE CYCLE . we use DFD or other tools to make the project design.. also create the data dictionary to valuate the flow of data.
4-CODING
now
we start the coding part. both coding and design run together. first we
select the language to develop the code it may be any programming
language..
5-TESTING
After
developing the software or project we test it whether it is working
according to need or not. it play important role to check the user
requirement .their are many method of testing like,
System Testing, Structure Testing, Unit Testing ,alpha testing, beta testing.
C Language- (C Programming) Introduction
C
is a procedural or a structure programming language. It was initially
developed by Dennis Ritchie between 1972. It was mainly developed as a
system programming language to write operating system to develop the
UNIX Operating System. The main features of C language include low-level
access to memory, simple set of keywords, and token,data type features
make C language suitable for system programming like operating system
or compiler development. C has capability of both middle and higher level language.
To start any programming language we need some basic component of programming language .
To start any programming language we need some basic component of programming language .
A- DELIMITER
Delimiter are the symbol which are used in programming language for different purpose.
# - for header files
{} - for block use
() - for any function
[]- for array
: - used in switch statement
; - for termination of line
B- DATA TYPES IN C LANGUAGE
B- DATA TYPES IN C LANGUAGE
Every
variable in C has an associated data type. Every data type which is
used requires different amounts of memory and performs operations. There are examples of some data types used in C:
int: according to name it is used to store an integer value. Like 10,30 . It require 2 byte of memory.
char:
This is the most basic data type in C. It stores a single character at
one time and requires a single byte of memory in almost all compilers.
float: this data type is used to store decimal numbers (numbers with floating point value) with single precision use.
double: It is used to store decimal numbers (numbers with floating point value) with double precision use.C - VARIABLES AND KEYWORDS USED IN C
C - VARIABLES AND KEYWORDS USED IN C
A
variable in simple word is a name which store some value and some
memory allocated to it. So basically a variable used to store some form
of data. Different types of variables require different amounts of
memory depends on what type of data is there.
How To Declare Variable:
How To Declare Variable:
Data type variable_name;
For multiple variables Declartion:
Data type variable1_name, variable2_name, variable3_name;
variable
name can consist of alphabets (both upper and lower case), numbers and
the underscore ‘_’ character. However, the name not started with a
number.
DIFFERENCE B/W VARIABLE DECLARATION AND DEFINITION
DIFFERENCE B/W VARIABLE DECLARATION AND DEFINITION
Variable
declaration refers to the part where a variable is first declared or
introduced before its first use. Variable definition is the part where
the variable is assigned a memory location and a value. Most of the
times, variable declaration and definition are done together
Like int a=10; is a Definition or Initialization.
D- CONST:
D- CONST:
const keyword is used to declare constant variables. When we
initialized Constant variables, we can’t change their value. constatnt value
assigned to them is unmodifiable.
Syntax:
const data_type var_name = var_value;
Note: Constant variables need to be compulsorily be
initialized during their declaration itself. The keyword const can used with
pointers.
USE BOOL IN C
USE BOOL IN C
CAN APPLY WITH : Bool Data Type in C++
CAN APPLY WITH : Bool Data Type in C++
The C99 standard for C language supports bool variables.
Unlike C++, Theare is no header file
needed to use bool, a header file “stdbool.h” must be included to use bool in
C.don’t save the program with .c extension , it will not compile, but if we
save it as .cpp, it will work fine.
Example ; with form of array .
int main()
{
bool arr[2] = {true,
false};
return 0;
}
E- INPUT/OUTPUT
Their is some function in c which is used for input and output..
PRINTF()-
This funtion is used to give output on the screen.to print any message or value in c on the output device(monitor)..
- Syntax is -
- printf("hello who r u");
- printf("%d",a); LET a is a variable of int type. int a=10;
- printf("value of a=%d",a);
SCANF()-
This
function is used for input . to read any value or any string such as
integer ,char ,float from input device (keyboard) we use this function.
Syntax.
- scanf("%d",&a) - let a is variable of int type.
- scanf("%c",&b) - let b is variable of char type.
F- Arithmetic Operators
An arithmetic operator perform airthmetic operations such as addition +, subtraction -, multiplication *, division / etc on numerical values (constants and variables)..
like - int a=10,b=20,c; c=a+b; printf("Sum is=%d", c);
G- Increment and Decrement Operators
Their is two programming operators in c language increment ++ and decrement -- to change the value of an operand by 1.
Increment ++operator increases the value by 1 whereas decrement operator -- decreases the value by 1. These two operators are unary operators, meaning they only operate on a single operand.
1- For exmp Preincrement: int a=5,b;b=++a;printf("Value of a=%d",a)printf("Value of b=%d",b)
Result is => a=6 and b=6;
2- Postincrement
int a=5,b;b=a++;printf("Value of a=%d",a)printf("Value of b=%d",b)
Result is => a=7 and b=6;
PRINTF()-
- Syntax is -
- printf("hello who r u");
- printf("%d",a); LET a is a variable of int type. int a=10;
- printf("value of a=%d",a);
- scanf("%d",&a) - let a is variable of int type.
- scanf("%c",&b) - let b is variable of char type.
F- Arithmetic Operators
An arithmetic operator perform airthmetic operations such as addition +, subtraction -, multiplication *, division / etc on numerical values (constants and variables)..
like - int a=10,b=20,c; c=a+b; printf("Sum is=%d", c);
G- Increment and Decrement Operators
Their is two programming operators in c language increment ++ and decrement -- to change the value of an operand by 1.
Increment ++operator increases the value by 1 whereas decrement operator -- decreases the value by 1. These two operators are unary operators, meaning they only operate on a single operand.
Comments
Post a Comment