BCA SYLLABUS AND QUICK REVISION NOTES
SOURCE: KHWAZA MUINUDDEEN CHISHTI AND LUCKNOW UNIVERSITY
subject ; c language complete notes
1. What is c language?
ans:c language is a middle level procedural programming oriented programming language developed by "DENNIS RITCHIE" at "AT&T's in Bell labourties in 1972 in USA.
SYNTAX OF C LANGUAGE:
It is the basic syntax of c langauge:
#include<stdio.h>
#include<conio.h>
void main()
{
statement;
}
syntax rule for C Program
- C is a case sensitive language so all programms in c written in lower case letter.
- C statement must be end with a semicolon.
- Whitespace is used in C to describe blanks and tabs
- space is required between keywords and identifiers
Keywords
- Keywords are preserved words that have special meaning in C language.
- The meaning has already been described.
- These meaning cannot be changed.
- There are total 32 keywords in C language.
Identifiers
In C language identifiers are the names given to variables, constants, functions and user-define data. These identifier are defined against a set of rules.
Rules for making identifiers
- An Identifier can only have alphanumeric characters ( a-z , A-Z , 0-9 ) and underscore( _ ).
- The first character of an identifier can only contain alphabet( a-z , A-Z ) or underscore ( _ ).
- Identifiers are also case sensitive in C. For example name and Name are two different identifier in C.
- Keywords are not allowed to be used as Identifiers.
Data types in C Language
Data types specify how we enter data into our programs and what type of data we enter. C language has some predefined set of data types to handle various kinds of data that we use in our program. These datatypes have different storage capacities.
C language supports 2 different type of data types Primary data types and Derived data types.
Data types in C Language
Data type specifies the size and value of data.
C language supports 2 different type of data types Primary data types and Derived data types.
Primary data types
There are mainly five types of primary data types in c langauge...
int
floAT
CHAR
DOUBLE
VOID
secondary data types
arrays
functions
structures
pointers.
Variables in C Language
Variable is the name of memory location where the data stores.
Rules to define variable name
- Variable name must be upto 8 characters.
- Variable name must not start with a digit.
- Variable name can consist of alphabets, digits and special symbols like underscore
_
. - Blank or spaces are not allowed in variable name.
- Keywords are not allowed as variable name.
Declaration of variable
Before making programm we have to declare the variable.
We have keep two things in our mind before declaring variable.
- It tells the compiler what the variable name is.
- It specifies what type of data the variable
#include<stdio.h>#include<conio.h>void main(){ int a,b,sum; //variable declaration a=30; b=20; sum=a+b; printf("Sum is %d",sum);} getch();
----student of KMCLU
BCA 1ST YEAR
Comments
Post a Comment