All Types GNIIT/NIIT Solution (Mr Jerry) Follow me on G+ and Twitter for more updates Twitter @mrjerry0001 #Write for us and get paid contact us On hike App:- @mrjerry4968
Pages
- Home
- HTML LAB@HOME
- DSA LAB@HOME
- WCD LAB@HOME
- C# LAB@HOME
- RDBMS LAB@HOME
- IADRT Lab@home
- EBDD LAB@HOME
- ACPC Lab@home
- LBEPS Lab@home
- ICTWC LAB@HOME
- SQL LAB@HOME
- WINDOWS APP LAB@HOME
- JAVA LAB@HOME
- NETWORK ESSENTIALS + LAB@HOME
- ASP.NET LAB@HOME
- LBEPS CYCLE TEST
- ASP.NET CYCLE TEST
- JAVA CYCLE TEST
- RDBMS CYCLE TEST
- DSA CYCLE TEST
- NIIT-HTML CYCLE TEST
- NIIT ASSIGNMENTS
- NIIT PROJECTS
- CORE JAVA NOTES
- NIIT BOOKS
- NIIT MT SOLVED
Friday, 28 July 2017
Thursday, 1 June 2017
Decision Making in C ~ mkniit
Decision making in C
Decision making is about deciding the order of execution of statements based on certain conditions or repeat a group of statements until certain specified conditions are met. C language handles decision-making by supporting the following statements,
- if statement
- switch statement
- conditional operator statement
- goto statement
Variables in C Language ~ mkniit
Variables in C Language
A variable is a name that may be used to store a data value. Unlike constant, variables are changeable, we can change value of a variable during execution of a program. A programmer can choose a meaningful variable name. Example : average, height, age, total etc.
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.
Data types in C ~ mkniit
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
These are fundamental data types in C namely integer(int), floating(float), charater(char) and void.
Derived data types
Derived data types are like arrays, functions, stuctures and pointers. These are dicussed in detail later.

Integer type
Integers are used to store whole numbers.
Size and range of Integer type on 16-bit machine
| Type | Size(bytes) | Range |
|---|---|---|
| int or signed int | 2 | -32,768 to 32767 |
| unsigned int | 2 | 0 to 65535 |
| short int or signed short int | 1 | -128 to 127 |
| long int or signed long int | 4 | -2,147,483,648 to 2,147,483,647 |
| unsigned long int | 4 | 0 to 4,294,967,295 |
Floating type
Floating types are used to store real numbers.
Size and range of Integer type on 16-bit machine
| Type | Size(bytes) | Range |
|---|---|---|
| Float | 4 | 3.4E-38 to 3.4E+38 |
| double | 8 | 1.7E-308 to 1.7E+308 |
| long double | 10 | 3.4E-4932 to 1.1E+4932 |
Character type
Character types are used to store characters value.
Size and range of Integer type on 16-bit machine
| Type | Size(bytes) | Range |
|---|---|---|
| char or signed char | 1 | -128 to 127 |
| unsigned char | 1 | 0 to 255 |
void type
void type means no value. This is usually used to specify the type of functions.
Operators in C Language ~ mkniit
Operators in C Language
C language supports a rich set of built-in operators. An operator is a symbol that tells the compiler to perform certain mathematical or logical manipulations. Operators are used in program to manipulate data and variables.
C operators can be classified into following types,
- Arithmetic operators
- Relation operators
- Logical operators
- Bitwise operators
- Assignment operators
- Conditional operators
- Special operators
Keywords and Identifier in C ~ mkniit
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.
| auto | double | int | struct |
| break | else | long | switch |
| case | enum | register | typedef |
| const | extern | return | union |
| char | float | short | unsigned |
| continue | for | signed | volatile |
| default | goto | sizeof | void |
| do | if | static | while |
C Syntax Rules ~ mkniit
C Language Syntax Rules
C language syntax specify rules for sequence of characters to be written in C language. The rule specify how character sequence will be grouped together to form tokens. A smallest individual unit in c program is known as C Tokens. Tokens are either keyword, identifier, constant, variable or any symbol which has some meaning in C language. A C program can also be called as collection of various tokens.
Example of C tokens,
| int | curly braces { } | comments | semicolon ; |
C Input / Output ~ mkniit
C Input output function
C programming language provides many of the built-in functions to read given input and write data on screen, printer or in any file.
scanf() and printf() functions
#include<stdio.h>
#include<conio.h>
void main()
{
int i;
printf("Enter a value");
scanf("%d",&i);
printf( "\nYou entered: %d",i);
getch();
}My First C program ~ mkniit
First C language Program
Lets see how to write a simple c program
#include <stdio.h>
#include <conio.h>
int main()
{
printf("Hello,World");
getch();
return 0;
}
Different parts of C program.
- Pre-processor
- Header file
- Function
- Variables
Features of C ~ mkniit
Features of C language
- It is a robust language with rich set of built-in functions and operators that can be used to write any complex program.
- The C compiler combines the capabilities of an assembly language with features of a high-level language.
- Programs Written in C are efficient and fast. This is due to its variety of data type and powerful operators.
- It is many time faster than BASIC.
- C is highly portable this means that programs once written can be run on another machines with little or no modification.
Overview of C language ~ mkniit
C is a structured programming language developed by Dennis Ritchie in 1973 at Bell Laboratories. It is one of the most popular computer languages today because of its structure, high-level abstraction, machine independent feature. C language was developed with UNIX operating system, so it is strongly associated with UNIX, which is one of the most popular network operating system in use today and heart of Internet data superhighway.
History of C language
C language has evolved from three different structured language ALGOL, BCPL and B Language. It uses many concepts from these languages and introduced many new concepts such as data types, struct, pointer. In 1988, the language was formalised by American National Standard Institute(ANSI). In 1990, a version of C language was approved by the International Standard Organisation(ISO) and that version of C is also referred to as C89.
Subscribe to:
Posts (Atom)