apurva's Site

apurva appu

Operators in C

Definition: It is operates on values or variable. Types of operators:Arithmetic operatorsRelational operatorsAssignment operatorLogical operatorsBit wise operatorscomma operatorssize of operatorsTernary operatoroperators are used in all programs.in e...

Find sum of elements in an array

This is a problem which asks to find sum of all elements in an array. Approach 1: Run a for loop from first element to the last ,use a auxiliary variable sum and add each variable as you run through the loop. code for this approach looks like int sum=0...

LCM of two numbers

It is a very common mathematical procedure .we can calculate l.c.m using prime factors from each number and find common prime factors from the two numbers. or else we can just calculate G.C.D ,with help of it we can calculate l.c.m. Calculating L.C....

Problem solved using sorting

PROBLEM STATEMENT: There is a girl named "winnie the pooh" .she have a bag of chocolate packets each with a different number of chocolates ,her father asked her to take only two packets from whole bag. winnie the pooh is very fond of chocolates, she ...

Sorting problems

This is a process of re-arranging elements in such a way that numbers are in ascending or descending order . This process can be performed using various Techniques .some of them are 1)Bubble sort 2)insertion sort 3)merge sort 4)Quick sort 5)Merge sort ...

Pattern printing problems

In this kind of problems we are asked to print any pattern using any special characters like '@' or '#' or '*' or even using numbers. Topic here says how to print patterns like a)right angled triangle * * * * * * * * * * * * * * * b) reverse of pa...

Searching problems

Search: As already known array elements are accessed using indices ,the process of finding the index of given element ,given element value is called a search operation. Types of searching:Linear searchbinary searchTri-nary search e.t.cIn Method in pyth...

Important points to remember about arrays

An array is a sequence of contiguous memory cells, all of the same size. The array name is an alias for a const-typed pointer to the first cell of the array. Array doesn't initializes it's values,during definition int a[10]; for(int i=0;i<10;i++) p...

Continuation of Arrays methods

Today we discuss about arrays methods Arrays can be accessed using negative indexes unlike C .C doesn't support negative indexes and it is also a advantage. Consider list A =[1,2,3,4,5,6,7] then last elements can be accessed using 'negative indexes' A ...

A very first step to enter into coding practice

Today we will be discussing about arrays . ARRAYS: It is a linear data structure used to store a list of homogeneous data under a single name. Consider a program in which you need to store 10 values and add 10 other values to that then in that case yo...