Wednesday, May 24, 2017

uva problem solution 10370 - Above Average


problem link :

Discuss: In this problem you have to make the average of numbers then check linearly which number is greater then the average then just make percentage with total numbers and above the average number.

try yourself before see the code


uva problem solution 10323 - Factorial! You Must be Kidding!!!


problem link

Discuss: it is just kind of tricky problem. you just can do on calculator and convert it in programming language. if it is less then and it's even or greater then 0 and less then 8  then it is underflow. if it is less then 0 and it's a odd or greater then 13 then it's overflow. otherwise you just print the factorial of n


try yourself before see the code


uva problem solution 11839 - Optical Reader



problem link :


Discuss: This is just easy problem to solve.Check the number if it is less then 127 and it's number of one then just print that number.


try yourself before see the code;



Tuesday, May 16, 2017

uva problem solution 11934 - Magic Formula



problem link



Discussion: It is just a simple problem just evaluate the value of function inside loop and change the value of x with the increasing value of i.


try yourself before see the code.


uva problem soultion 382 - Perfection


problem link :

Discussion: just simply make divisor and add them and follow the instruction of problem. make right align with %5 specifier..

try yourself before see the code.



uva problem solution 483 - Word Scramble



problem lInk

Discussion:  There is tricky part in this problem. Many check string in if condition that not equal to whitespace. and else print the reverse word. but at the the end  word there is problem with the check of whitespace and last word don't print. to avoid it in if condition check whitespace and '\0' character. and  in else store the word in another string.

try your self before see the code.


Monday, May 15, 2017

uva problem 371 - Ackermann Functions


problem link

Discussion : It is simple while loop problem.you can do it easily from the description of problem.

At first try yourself,if you can't then only see the code.


uva problem 10591 - Happy Number


problem link

Discussion : In this problem  make sum of every digit of number. if until the sum less then 10 or 1. replace n with sum. if sum=1 then number is happy otherwise unhappy.

at first try yourself,if you can't then only see the code.


uva problem 11650 - Mirror Clock


problem link:


It is just a simple problem to solve.Just subtract hour from 11. if it is less than or equal 0 then add 12 with hour. and for min if it is not equal to zero than subtract min from 60.  and for align use %02 specifier .


at first try yourself but if you can't then only see the code.


11389 - The Bus Driver Problem uva problem



problem linkk:

Discussion : in this problem we just have to sort the evening and morning hours. then add with smallest one with greatest one then compare it with d.  if it exceed then multiple with over time rate


Saturday, May 6, 2017

12614-Earn for future uva problem

problem link:

Discussion: In this problem you just have to find the maximum value of card..and then print it..don't panic with bitwise operator.

here the code..at first try yourself.if you can't then only see the code.otherwise you can't develop yourself in programming.


uva problem-12709 falling ant


problem link:

discussion:  Just compare the value  of H if H is large then downward acceleration also large..
if H and large H is equal then compare the volume of them the large volume should assign to the large volume.

here are the code, before see the code try yourself first. otherwise you can't develop in programmin


Friday, May 5, 2017

138-Street number uva problem

problem link:


#include<stdio.h>
int main()
{
    long long n,x=8,tc=0;
    double n2;
    while(1)
    {
        n2=sqrt((x*x+x)/2);
        n=n2;
        if(n==n2)
        {
            printf("%10lld%10lld\n",n,x);
            tc++;
        }
        if(tc==10)
        break;
        x++;
    }
return 0;
}