Posts

Showing posts from August, 2020

Variables In C

Image
Variables In C Definition  Variable in C is  "Name" given to "Memory Location", which is used to store data value of any kind. Variables can be declared  with any Data Types available  in C. for example : int, float, char and double.  int n1,n2,sum ; float pi, area ; char choice ; double Gross_Total ; Variables can also be declared using User Defined Data Types in C like structure. struct student s1 ;  here s1 is variable of type student. we can also have pointer variables, arrays etc. int *ptr ; Here ptr is pointer variable of type integer. float temp[5] ; Here temp is array name which can hold temperature of 5 cities. Compiler can process data only if at is available in memory.   Variables  create memory blocks which are used to store data values, these stored values are used during execution of program.  Example int num=10 ; here " num " is variable of type "integer" and it holds value " 10 " as data. Integer Data Occupies 2 Bytes o...