In last session we discuss about below points.
1. What is Comments in c lang?
we have mainly two types of commenting in c language.
a.Single line comment
Single line comments are represented by "//".
single line comments are used to comments single line in c language.
b.Multi line comments
Multiline comments are represented by "/* ----------*/".
Multiline commenting are used to comments more than one line in c language.
2. Datatypes & identifiers in c lang?
3. Keywords in c lang
4. What is white space in c-lang?
5. Input And Output Functions in c lang?
What is variables in c lang?
What are the laws in c lang for variable declaration?
- we can not use keyword(reserve keywords) as variable name;
- can containt alphabets, digits, underscore.
- can't start with a digit. /// int One
- white space and rezerved keyword is not allowed.
Valid Example for variable declaration:
int one = 1;
char one = 'a';
Invalid Example for variable declaration:
int 121one = 1;
char 1 = 'a';
//Single character declaration in c
char name = 's';
//string declaration in c
char name[] = "Learn";
//intiger declaration
int name = 12;
//floting value declaration
float name = 10.50;
Datatypes in c language
datatypes specifies the size & type of value that can be stored as an variable.
1) Basic Data type
- int = { 2 byte & -32768 to 32767}
- char = { 1 byte & -128 to 127}
- float = { 4 byte & }
- double = { 8 byte }
Small assignment for everybody: Print Size of int , char , float in dev C++;
2) Derived Data type //depending upon project
- Array
- Pointer
- structure
- union
3) Enumeration Data type: enum
4) Void Data type: void // empty
More information for c lang
- Datatype size by 32 bit architecture
- find size of data type in your programm with
- printf(" size of int :%d" , sizeof(int));
- data types consume memory / ram of from your system.
- Example with 4 gb ram
- -----> bits to Gb conversion
Assaignment of the day?
- Program 1: WAP to display first name, middle name, last name and scored marks, grades of candidates who participated in a quiz competition using formatted output.
- Program 2: WAP to display the list of at least 5 fruits and their quantities with unit price.
- Program 3. WAP to display name of your friend, date of birth and city, where output should be formatted properly
- Program 4. WAP to display the well formatted output to list the order details contains order id, order date, customer name, contact no, due amount
Post a Comment