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

Monday 8 April 2019

Skill Rack Daily MCQ Answer and Solution - 08/04/2019

Skill Rack

Daily MCQ Answer & Solution

Date : 08/04/2019

REFID: 40447

What amount would a man receive on a principal of Rs. 4000 after two years on simple interest at the rate of 5 percent per annum?

Answer : 4410

Solution :
principal = 4000
5% per annum
4200 per annum
for 2 year 4410
answer is 4410 

Skill Rack Daily Challenge Solution - 08/04/2019

 Skill Rack

Daily Challenge Solution

Date : 08/04/2019



ProgramID- 8467
Replace Vowels - Circular Fashion

The program must accept a string S as the input. The program must replace all the vowels in S by the vowels a, e, i, o and u in a circular manner. Finally, the program must print the modified string as the output.
Note: All the alphabets in S are only in lower case.

Boundary Condition(s):
1 <= Length of S <= 100

Input Format:
The first line contains the string value S.

Output Format:
The first line contains the modified string value of S.

Example Input/Output 1:
Input:
kingkong

Output:
kangkeng

Explanation:
The vowels in the string kingkong are i and o. So they are replaced by a and e.
Hence the output is kangkeng

Example Input/Output 2:
Input:

icecreamchocolate

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

int main()
{
    char s[100],a[5]={'a','e','i','o','u'};
    int j=0,i;
    scanf("%s",s);
    for(i=0;s[i]!=NULL;i++)
    {
        if(s[i]=='a'||s[i]=='e'||s[i]=='i'||s[i]=='o'||s[i]=='u')
        {
            s[i]=a[j];
            j++;
        }
        if(j>5)
        {
            j=0;
        }
    }
    printf("%s",s);
    return 0;

}
------------------------------------------------------------------------------------- 

Saturday 6 April 2019

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

Skill Rack
Daily MCQ Answer & Solution
Date : 07/04/2019

REFID: 40444
Aman's expense is 30% more than Vimal's and Vimal's expense is 10% less than Raman's. If the sum of their expenses is Rs. 6447, then what would be Aman's expense?

Answer : 2457

Solution:
Aman Expenses = 30 % > Vimal Expense
Vimal Expense = 10 % < Raman Expense
Total Sum of their expense Aman + Vimal + Raman = Rs 6447
LET us assume vimal expense treat as X  
AMAN expense = Rs 130 and raman expense = Rs 
Proportion of expense of aman, vimal and raman respectively = 130; 100; 
= Rs 2457


Skill Rack Daily Challenge Solution - 07/04/2019

Skill Rack

Daily Challenge Solution

Date : 07/04/2019 



ProgramID- 8465

Product - Swap Unit Digits

The program must accept two integers X and Y as the input. The program must print the product of X and Y after swapping their unit digits as the output.
Boundary Condition(s):
1 <= X, Y <= 10^9
Input Format:
The first line contains the value of X and Y separated by a space.
Output Format:
The first line contains the product of X and Y after swapping their unit digits.
Example Input/Output 1:
Input:
984 51
Output:
52974
Explanation:
After swapping the unit digits of 984 and 51, their values become 981 and 54.
So the product of 981 and 54 is 52974.
Hence the output is 52974
Example Input/Output 2:
Input:
3988477 48754884
Output:
194457599172438

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

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

int main()
{
    long long int x,y,a,b,ans;
    scanf("%lld %lld",&x,&y);
    a=x%10;
    x=(x/10)*10;
    b=y%10;
    y=(y/10)*10;
    ans=(x+b)*(y+a)
    printf("%lld",ans);
    return 0;
}
---------------------------------------------------------------------------------------------

Skill Rack Daily MCQ Answer and Solution - 06/04/2019

Skill Rack

Daily MCQ Answer and Solution

Date : 06/04/2019


REFID: 40437

Choose the option to replace the question mark using approximation.
23.999 x 9.004 x 16.997 = ?

Answer : 3700

Solution:
23.999 * 9.004 * 16.997 = 3672.83067101

3672.83067101 ~ 3700
the answer is 3700

Skill Rack Daily Challenge Solution - 06/04/2019

Skill Rack

Daily Challenge Solution

Date : 06/04/2019



ProgramID- 8468

Sum of Dice Values

Pairs of integers are passed as the input to the program. The integers in each pair represent values of two dice in a game. If both the values are same, then the dice are rolled again. If the values are different, then the game ends. The program must print the sum of total number of values obtained from the dice at the end of the game.
Boundary Condition(s):
1 <= Value of each integer <= 6
Input Format:
The lines contain two integers each separated by a space.
Output Format:
The first line contains the sum of all values obtained from the dice.
Example Input/Output 1:
Input:
4 4
3 3
2 5
Output:
21
Explanation:
The dice are rolled until two different values are obtained.
So the total sum is 4 + 4 + 3 + 3 + 2 + 5 = 21
Example Input/Output 2:
Input:
5 5
1 1
2 2
4 4
5 4
Output:
33

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

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

int main()
{
    int d1,d2,i,sum=0;
    for(i=0;;i++)
    {
        scanf("%d %d",&d1,&d2);
        sum=sum+(d1+d2);
        if(d1!=d2)break;
    }
    printf("%d",sum);
return 0;
}
--------------------------------------------------------------------

Thursday 4 April 2019

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

Skill Rack

Daily MCQ Answer & Solution

Date : 05/04/2019

REFID: 40432

In how many different ways can 4 boys and 3 girls be arranged in a row such that all the boys stand together and all the girls stand together?

Answer : 288

Solution : 
 4!3!2=288

Skill Rack Daily Challenge Solution - 05/04/2019

Skill Rack

Daily Challenge Solution

Date : 05/04/2019



ProgramID- 8469

Inplace Swap First Half and Second Half

The program must swap the first half and second half in the string str passed as the argument to the function swapFirstHalfSecondHalf.

Note: The length of the string str is always even.

Example Input/Output 1:
Input:
capslock
Output:
lockcaps
Explanation:
The first half of the string str is "caps".
The second half of the string str is "lock".
After swapping, the str becomes "lockcaps".
Example Input/Output 2:
Input:
keymap
Output:
mapkey

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

void swapFirstHalfSecondHalf(char *str)
{
    int l,i;
    char *str1,*str2;
    str1=(char *)malloc(50);
    str2=(char *)malloc(50);
    l=strlen(str);
    int j=0;
    for(i=0;i<(l/2);i++)
    {
        str1[j]=str[i];
        j++;
    }
    j=0;
    for(i=(l/2);i<l;i++)
    {
        str2[j]=str[i];
        j++;
    }
    strcat(str2, str1);
    for(int k=0;k<l;k++)
    {
        str[k]=str2[k];
    }
}
-------------------------------------------------------------------------------------

Wednesday 3 April 2019

Skill RackDaily MCQ Answer & Solution - 04/04/2019

Skill Rack

Daily MCQ Answer & Solution

Date : 04/04/2019


REFID : 12891

In an election involving two candidates, 68 votes were declared invalid. The winning candidate scores 52% and wins by 98 votes. The total number of votes polled is ?


Answer : 2518

Solution : 

Let the number of valid votes be x.
Winning candidate=52%
Losing candidate =100-52 =48%
According to the question 
52% of x - 48% of x = 98 
=> 4% of x = 98
=> 4/100*x=98
<=> x = 98 * 25 = 2450.
Invalid votes = 68
∴ Total number of votes polled = (2450 + 68) = 2518.

Skill Rack Daily Challenge Solution - 04/04/2019

Skill Rack
Daily Challenge Solution
Date : 04/04/2019




ProgramID- 8462

Replace Additional Space

A string S with space is passed as the input to the program. The program must print the words in S separated by exactly one space character as the output and additional space characters must be removed if present.

Boundary Condition(s):
1 <= Length of S <= 1000

Input Format:
The first line contains the string S.

Output Format:
The first line contains the words separated by space.

Example Input/Output 1:
Input:
Practice       makes    perfect
Output:
Practice makes perfect
Explanation:
The additional spaces between words are removed so there is exactly 1 space between every two words.
Example Input/Output 2:
Input:
The process    needed    30       minutes   to finish
Output:
The process needed 30 minutes to finish


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

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

int main()
{
    char text[1000],blank[1000];
    int c=0,d=0;
    scanf("%[^\n]%*c",text);
    while(text[c]!=NULL)
    {
        if(text[c]==' ')
        {
            int temp=c+1;
            if(text[temp]!=NULL)
            {
                while(text[temp]==' '&&text[temp]!=NULL)
                {
                    if(text[temp]==' ')
                    {
                        c++;
                    }
                    temp++;
                }
            }
        }
        blank[d]=text[c];
        c++;
        d++;
    }
    blank[d]=NULL;
    printf("%s",blank);
    return 0;

}
-----------------------------------------------------------------------------------

Tuesday 2 April 2019

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

Skill Rack

Daily MCQ Answer & Solution

Date : 03/04/2019


REFID : 12890

On increasing the price of Bikes by 30%, their sale decreases by 20%. What is the effect on the revenue for the dealer? 

Answer : 4% increase

Solution :

 the prize is 100
so, 100*100=10000
increasing the price of bikes by 30%
so, 100+30=130
decreases by 20%
so, 100-20=80
130*80=10400
the effect on the revenue for the dealer is (10400/10000)= 104%
the answer is 4% increase

Skill Rack Daily Challenge Solution - 03/04/2019

 Skill Rack

Daily Challenge Solution

Date : 03/04/2019



ProgramID- 8459
Largest to Smallest Integer

The program must accept three integers as the input. The program must print the integers from the largest of the three integers to the smallest of the three integers in decreasing order as the output.

Boundary Condition(s):
1 <= Each integer value <= 10^7

Input Format:
The first line contains three integers separated by a space.

Output Format:
The first line contains integers separated by a space.

Example Input/Output 1:
Input:
6 2 8

Output:
8 7 6 5 4 3 2

Explanation:
The largest number is 8 and the smallest number is 2.
So the integers from 8 to 2 are printed.

Example Input/Output 2:
Input:
60 51 48

Output:
60 59 58 57 56 55 54 53 52 51 50 49 48

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

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

int main()
{
    int a,b,c,l,s;
    scanf("%d %d %d",&a,&b,&c);
    if(a>=b&&a>=c)
    {
        l=a;
    }
    else if(b>=a&&b>=c)
    {
        l=b;
    }
    else
    {
        l=c;
    }
    if(a<b&&a<c)
    {
        s=a;
    }
    else if(b<a&&b<c)
    {
        s=b;
    }
    else
    {
        s=c;
    }
   for(int i=l;i>=s;i--)
   {
       printf("%d ",i);
   }
return 0;
}
------------------------------------------------------------------------

Monday 1 April 2019

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

Skill Rack

Daily MCQ Answer & Solution

Date : 02/04/2019

REFID : 4547

From a point P on a level ground, the angle of elevation of the top tower is 30ยบ. If the tower is 100 m high, the distance of point P from the foot of the tower is:

Answer : 173m

Solution :

Height and Distance mcq solution image

Skill Rack Daily Challenge Solution - 02/04/2019

 Skill Rack

Daily Challenge Solution

Date : 02/04/2019



ProgramID- 8456
Comma Separated Positive Integers

The program must accept N integers separated by a comma as the input. The program must print the positive integers separated by a comma among the N integers as the output. If there is no positive integer then the program must print -1 as the output.

Boundary Condition(s):
1 <= N <= 100
-999 <= Each integer value <= 999

Input Format:
The first line contains the value of N.
The second line contains N integers separated by a comma.

Output Format:
The first line contains either the positive integers separated by a comma or -1.

Example Input/Output 1:
Input:
5
12,-10,78,-5,-99
Output:
12,78
Explanation:
The positive integers are 12 and 78. So they are separated by a comma and printed as the output.
Example Input/Output 2:
 
Input:
6
-41,-93,-91,-54,-59,-88
Output:
-1


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

int main()
{
    int n,c=0,a[100],b[100],i,j=0;
    scanf("%d",&n);
    for(i=0;i<n;i++)
    {
        scanf("%d,",&a[i]);
        if(a[i]>0)
        {
            b[j]=a[i];
            j++;
        }
        else
        {
            c++;
        }
    }
    if(c!=n)
    for(i=0;i<j;i++)
    {
        printf("%d",b[i]);
        if(i<j-1)
        {
            printf(",");
        }
    }
    else
    {
        printf("-1");
    }
 
    return 0;

}

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