Skip to main content

Posts

Showing posts from March, 2020

Datatypes

                       DATATYPES IN C What is datatype ??? C data types are defined as the data storage format that a variable can store a data to perform a specific operation. Data types are used to define a variable before to use in a program . Following are the examples of some very common data types used in C: char:  The most basic data type in C. It stores a single character and requires a single byte of memory in almost all compilers. int:  As the name suggests, an int variable is used to store an integer. float:  It is used to store decimal numbers (numbers with floating point value) with single precision. double:  It is used to store decimal numbers (numbers with floating point value) with double precision. DATA TYPE MEMORY (BYTES) RANGE FORMAT SPECIFIER short int 2 -32,768 to 32,767 %hd unsigned short int 2 0 to 65,535 %hu unsigned int 4 0 to 4,294,967,295 %u int 4 -...

Basics of C with example

                          C   language                             C is a procedural programming language. It was initially developed by Dennis Ritchie and Ken Thompson in the year 1972 at AT and T bell lab of USA .  It was mainly developed as a system programming language to write an operating system. The main features of C language include low-level access to memory, a simple set of keywords, and clean style, these features make C language suitable for system programmings like an operating system or compiler development. It is mainly used to convert high level code into low level language code and vice versa. High level language code includes.........     A,B,C......                                           ...

Difference in C and C++ language

  Difference between C and C++ Language.. C                            C is procedure oriented programming (POP). In C programs are divided into small parts known as functions. Encapsulation,abstraction,Inheritance and polymorphism are not supported in C. Inline functions and virtual functions are not available in C. Function overloading and operator overloading are not possible in C. C uses scanf() and printf() functions for input/output. C uses malloc() and free() functions for dynamic memory allocation and dealloaction. C does not support exception handling. Filename extension is . Follows top down approach in program design. Example...1.Program to add two numbers. #include <stdio.h> #include<conio.h> void main() {    int a,b,c;   printf("Enter two numbers :");   scanf("%d,%d",&a,&b);   c=a+b;   printf("Addition is : %d",c...