Search This Blog

Thursday, 25 April 2019

Skill Rack Daily MCQ Answer and Solution Date - 26/04/2019

Skill Rack
Daily MCQ Answer and Solution
Date : 26/04/2019


REFID: 40459

A number when subtracted by 1/7 of itself gives the same value as the sum of all the angles of a triangle. What is the number?

Answer : 210 

Solution :

sum of angles in a triangle are 180 deg According to given data

Sum of Triangle : 180.
1/7 th of 210 is : 30
hence 210 - 30 =180
so the answer is 210.

Skill rack Daily Challenge Solution Date - 26/04/2019

 Skill rack
Daily Challenge Solution
Date : 26/04/2019



ProgramID- 6447
Variable Discount

The program must accept an integer P which represents the price of an item in a supermarket as the input. The program must print the discount amount for P up to 2 decimal places based on the following conditions,
- If the price is less than or equal to Rs. 1000 then 10 percentage discount is applied.
- Else if the price is greater than Rs. 1000 then 10 percentage discount is applied up to Rs. 1000 and 5 percentage discount is applied for the remaining price amount.

Boundary Condition(s):
1 <= P <= 99999999

Input Format:
The first line contains the value of P.

Output Format:
The first line contains the discount price up to 2 decimal places.

Example Input/Output 1:
Input:
852
Output:
85.20

Example Input/Output 2:
Input:
1543
Output:
127.15

Solution :
----------------------------------------------------------------------

#include<stdio.h>
#include <stdlib.h>

int main()
{
    double price;
    scanf("%lf",&price);
    if(price<=1000)
    {
        price=0.10*price;
    }
    else
    {
        price=(0.05*(price-1000))+100;
    }
    printf("%.2lf",price);
}

---------------------------------------------------------------------- 

Saturday, 20 April 2019

Skill Rack Daily MCQ Answer & Solution Date - 21/04/2019

Skill Rack

Daily MCQ Answer & Solution

Date : 21/04/2019

REFID: 40454

1/4 of 3/5 of 6/5 of a number = 54. What is the number?

Answer : 300

Solution :
Let`s consider a  number as `X’
6/5 of X is 6X/5
3/5 of 6X/5 is (3/5)x(6X/5)=18X/25
1/4 of 18X/25 is (1/4)x(18X/25)=18X/100
 so,
According to the question 18X/100=54
And hence X=300

Skill Rack Daily Challenge Solution Date - 21/04/2019

Skill Rack

Daily Challenge Solution

Date : 21/04/2019


ProgramID- 8007

Same Adjacent - Asterisks

The program must accept a string S as the input. The program must print YES if the adjacent characters of each asterisk (*) are same. Else the program must print NO as the output.
Note: The string does not contain any continuous asterisks.
Boundary Condition(s):
1 <= Length of S <= 100
Input Format:
The first line contains the string S.
Output Format:
The first line contains either YES or NO
Example Input/Output 1:
Input:
ab*bkt*tz
Output:
YES
Explanation:
The adjacent characters of the first * are b and b. Here the adjacent characters are same.
The adjacent characters of the second * are t and t. Here the adjacent characters are same.
Hence the output is YES
Example Input/Output 2:
Input:
cp*pl*l*h
Output:
NO

Solution :
--------------------------------------------------------------------


#include<stdio.h>
#include <stdlib.h>

int main()
{
    char s[100];
    int same=0,star=0;
    scanf("%s",s);
    for(int i=0;s[i]!=NULL;i++)
    {
        if(s[i]=='*')
        {
            if(s[i-1]!=NULL&&s[i+1]!=NULL)
            {
                if(s[i-1]==s[i+1])
                {
                    same++;
                }
                star++;
            }
        }
    }
    if(same==star)printf("YES");
    else printf("NO");
    return 0;
   
}
--------------------------------------------------------------------
**Don't copy this same , While copying please change the variables , Otherwise you will be suffer **

Friday, 19 April 2019

Skill Rack Daily MCQ Answer & Solution Date - 20/04/2019

Skill Rack

Daily MCQ Answer & Solution

Date : 20/04/2019

REFID: 40451

A bus started its journey from Ramgarh and reached Devgarh in 44 minutes at an average speed of 50 km/h. If the average speed of the bus is increased by 5 km/h, how much time will it take to cover the same distance?

Answer : 40 mins

Solution:


Description for Correct answer:
Distance between Ramgarh and Devgarh = 50×4460 = 1103 km

New speed = 55 kmph

= 5560 km / minute

∴ Required time =  Distance Speed

= 1103×6055 = 40 minutes

Skill Rack Daily Challenge Solution Date - 20/04/2019

Skill Rack

Daily Challenge Solution

Date : 20/04/2019



ProgramID- 8515

Area of N Objects

The program must accept the shape and dimensions of N objects as the input. The program must print the sum of the area of all the objects as the output. The shape can be square or rectangle.
Boundary Condition(s):
1 <= N <= 1000
Input Format:
The first line contains N.
The next N lines contain the shape followed by dimension(s) side for square and length and breadth for rectangle separated by a space.
Output Format:
The first line contains the sum of the area of all the objects.
Example Input/Output 1:
Input:
4
square 5
rectangle 4 2
rectangle 3 10
square 11
Output:
184
Explanation:
The first object is square it's area is 5*5 = 25. The total area is 25.
The second object is rectangle it's area is 4*2 = 8. The total area is 33.
The third object is rectangle it's area is 3*10 = 30. The total area is 63.
The fourth object is square it's area is 11*11 = 121. The total area is 184.
Example Input/Output 2:
Input:
6
square 25
rectangle 17 24
square 5
rectangle 40 12
square 34
square 48
Output:
4998

Solution :
----------------------------------------------------------------------------------------
#include<stdio.h>
#include <stdlib.h>

int main()
{
    int n,ans,total=0;
    char s[20];
    scanf("%d",&n);
    for(int i=0;i<n;i++)
    {
        scanf("%s",s);
        if(s[0]=='s')
        {
            int a;
            scanf("%d",&a);
            ans=a*a;
        }
        else
        {
            int a,b;
            scanf("%d %d",&a,&b);
            ans=a*b;
        }
        total=total+ans;
    }
    printf("%d",total);
}
----------------------------------------------------------------------------------------

Thursday, 11 April 2019

Skill Rack Daily MCQ Answer & Solution - 12/04/2019

Skill Rack

Daily MCQ Answer & Solution

Date : 12/04/2019

REFID: 41304

Instead of multiplying a number by 14, a student multiplied it by 6 and got an answer which differs by 384. What is the value of the number? 

Answer : 48

Solution :
14x-6x=384
8x=384
x=384/8
x=48
answer is 48