Вы находитесь на странице: 1из 13

Govt.

Engineering College Bikaner

C Programming Language

Branch: CSE – 2
Batch: B1
Roll No: 18EEBCS065
Submitted By:- Rajesh Yadav
Submitted to:- Mr Vikram Singh
 1.FLOW CONTROL:
 if...else Statement-
 The if/else statement executes a block of code if a specified condition
is true. If the condition is false, another block of code can be executed.
The if/else statement is a part of JavaScript's "Conditional" Statements,
which are used to perform different actions based on different
conditions,
 for Loop-
 In computer science, a for-loop (or simply for loop) is a control flow
statement for specifying iteration, which allows code to be executed
repeatedly. ... For-loops are typically used when the number of
iterations is known before entering the loop.
//program of find maximum number in three
Number
#include<stdio.h>
int main()
{
int a,b,c;
Printf(“enter any three number”);
Scanf(“%d %d %d”,&a,&b,&c); .
If(a>b&&a>c)
{
Printf(“maximum number is=“,a);}
else if(b>c&&b>a)
{printf(“maximum number is=“,b);}
else if(c>a&&c>b)
{printf(“maximum number is=“,c);}
return 0;}
do...while Loop-
The do while loop checks the condition at the end of the loop. ... The do while loop is
an exit controlled loop, where even if the test condition is false, the loop body will be
executed at least once. An example of such a scenario would be when you want to
exit your program depending on the user input.

break & continue-


The break statement causes a do, for, switch, or while statement to terminate. This
program allows the user to type up to 10 numbers, and displays the sum of all the
numbers entered at the end. If the user enters 0, the break causes the loop to
terminate early (before 10 numbers have been entered)
switch Statement-
switch statement. Advertisements. A switch statement allows a variable to be
tested for equality against a list of values. Each value is called a case, and the
variable being switched on is checked for each case.
goto Statement-
C Goto Statement. The C goto statement is also known as jump statement. It is
used to transfer control to the other part of the program. It unconditionally
jumps to the specified label.
 ->FUNCTIONS:

 C Functions-
 A function is a group of statements that together perform a task. Every C program has at least
one function, which is main(), and all the most trivial programs can define additional functions.
... A function declaration tells the compiler about a function's name, return type, and
parameters.

 Function Types-
 A function is a group of statements that together perform a task. Every C program has at least
one function, which is main(), and all the most trivial programs can define additional functions.
... A function declaration tells the compiler about a function's name, return type, and
parameters.
Function Overloading-
Function Overloading is defined as the process of having two or more function with the
same name, but different in parameters is known as function overloading in C. In
function overloading, the function is redefined by using either different types of
arguments or a different number of arguments.

Storage Class-
A variable's storage class gives information about the storage location of variable in
memory, default initial value, scope of the variable and it's lifetime. Storage class
specifiers supported in C are auto, register, static, extern and mutable. This is the
default storage class we have been using so far.
 C Recursion-
 When function is called within the same function, it is known as
recursion.The function which calls the same function, is known as recursive
function. A function that calls itself, and doesn't perform any task after
function call, is known as tail recursion.
 ->STRUCTURES:

 Structure-
 Structure is a collection of variables of different data types under a single
name. It is similar to a class in that, both holds a collecion of data of
different data.

 Pointers to Structure-
 pointers to structures just as it allows pointers to int or char or float or any
other data type. The pointers to structures are known as structure pointers.
 ->ARRAYS & STRING:

 C Arrays-
 An array is a collection of elements of the same type placed in contiguous memory
locations that can be individually referenced by using an index to a unique
identifier. ... As expected, an n array must be declared prior its use. A typical
declaration of array type name [elements]; .

 Multidimensional Arrays-
 Multidimensional Arrays. The multidimensional array is also known as rectangular
arrays. It can be two dimensional or three dimensional. The data is stored in
tabular form (row * column) which is also known as matrix.
 C String-
 Strings in C: Strings are defined as an array of characters. The difference
between a character array and a string is the string is terminated with a
special character '\0'. It will append copy of the source string in the
destination string.
 ->POINTERS:
 C Pointer-
 Pointer is an avariable which contain address of anuther variable,

 Pointers and Arrays-


 C Pointers and Arrays. ... Pointers are the variables that hold address.
Not only can pointers store address of a single variable, it can also
store address of cells of an array. Consider this example: int* ptr; int
a[5]; ptr = &a[2]; // &a[2] is the address of third element of a[5].

 Pointers and Functions-


 Pointers and Functions. A function is a user defined operation that
Thank You

Вам также может понравиться