Category Archives: Programming Problem Solving

Flags in C

Reference:
https://www.daniweb.com/programming/software-development/threads/201233/use-of-flag-in-c

Swap in C

Swap in C

 

Triangular Number Java Code True or False

Here yo can see what is triangular number:

https://en.wikipedia.org/wiki/Triangular_number

 

Problem 5 from 52 programming problems book

 

Problem 4 from 52 programming problems book

Solution:

 

Problem 3 from 52 programming problems book

1st approach:

2nd approach:

 

Problem 1 from 52 programming problems book

 

http://ideone.com/ItvUGS

Problem 2 from 52 programming problems book

I was using code blocks but it was giving me compiler error for c++11 was not on the list so i tried ideone’s compiler and got the correct result

https://ideone.com/zjwlWo

Here is the problem solution link:

UVA Solution 11547 – Automatic Answer

Editorial:
Actually I was facing the problem how can make the second digit from the left that named as tens column.

So I did this algorithm.

1.First made the steps for n
2. Then made the n divided by 10 and take only the pure value no fraction
3. Then made the pure value divided with 10 as we want to find out the 10th’s coloumns
4. Then for the negative I used the absolute value builtin function.

Reference:
https://saicheems.wordpress.com/2013/11/15/uva-11547-automatic-answer/

Code:

 

UVA solution 11455 – Behold my quadrangle

Editorial:
we need to read those :
https://en.wikipedia.org/wiki/Quadrilateral
https://www.mathsisfun.com/quadrilaterals.html

And one thing to be remebered that to be a quadrangle we have to follow this condition:
a+b+c+d=360
so a<=b+c+d  && b<=a+c+d && c<=b+c+d

and for square every side is same and for rectangle opposite side is same

 

Pattern Printing:Full pyramid in C

 

Output:

 

C problem solution:Anagrams

Anagram:

Output:

 

5*5 matrix in Javascript,Unityscript(Multidimensional Array)

http://stackoverflow.com/questions/10021847/for-loop-in-multidimensional-javascript-array

http://jsfiddle.net/TRR4n/

My code:

//To show the array value
https://jsfiddle.net/zakilive/6yrx1opj/1/

//To print the array

http://www.trans4mind.com/personal_development/JavaScript/Array2D.htm
http://www.javascripter.net/faq/twodimensional.htm
http://www.plus2net.com/javascript_tutorial/array-two-dimension.php

 

HackerRank – Simple Array Sum

 

URI Online Judge Solution |1038 Snack

Here I tried to write everything in standard C++