Consider a matrix and print principal diagonal and opposite diagonal from the given matrix.
Principal Diagonal:
Condition is if row number is equal to column number ,then it is principal diagonal.
123451102030405021112131415321222324254313233343554142...
apurva apurva
Posted on February 19th, 2019
PROBLEM STATEMENT :
You will be given two arrays of integers and asked to determine all integers that satisfy the following two conditions:The elements of the first array are all factors of the integer being consideredThe integer being considered is a ...
apurva apurva
Posted on February 18th, 2019
Problem statement:
John works at a clothing store. He has a large pile of socks that he must pair by color for sale. Given an array of integers representing the color of each sock, determine how many pairs of socks with matching colors there are.
Expla...
apurva apurva
Posted on February 17th, 2019
PROBLEM STATEMENT:
You are in charge of the cake for your niece's birthday and have decided the cake will have one candle for each year of her total age. When she blows out the candles, she will only be able to blow out the tallest ones. Your task is ...
apurva apurva
Posted on February 16th, 2019
PROBLEM STATEMENT:
Given the participants' score sheet for your University Sports Day, you are required to find the runner-up score. You are given scores. Store them in a list and find the score of the runner-up.
This is a problem from hackerrank pyth...
apurva apurva
Posted on February 15th, 2019
This post is about how normal loops we use can be modified to access in differently .
DISPLAY ONLY EVEN POSITION CHARACTERS
Let consider a question asks to display only even position array elements then approach one uses is pass through each and ever...
apurva apurva
Posted on February 14th, 2019
Many programs uses bit wise operators to solve many problems.
Find given number is Even or Odd: "and" operator is used
example:
consider a decimal number 'a'
if a is 10 it's binary notation is 1010 the least significant bit is 0
if decimal number 1...
apurva apurva
Posted on February 13th, 2019
Consider an array , we are asked to find the minimum and maximum elements from an array.
The explanation is :
consider two variables min,max and initialize them with INT_MAX,INT_MIN values
while you traverse across the array , if min variable value is ...
apurva apurva
Posted on February 12th, 2019
C has a user defined datatype and Structure is one of them.
Syntax for creating a structure:
struct
{
datatype variable_1;
datatype variable_2;
};
The points to remember about structure are:
1.A structure is used in data structures for creation of no...
apurva apurva
Posted on February 11th, 2019
DATATYPE: What type of data is given into a variable is called datatype.
Different type of datatypes:Primitive datatypeDerived datatypesPRIMITIVE DATATYPE: These are built in very commonly used datatypes they are char ,int,float,void.
INTEGER DATATYPE:...
apurva apurva
Posted on February 9th, 2019