Search This Blog

Tuesday 21 May 2019

Skill Rack Daily Challenge Solution Date - 22/05/2019

Skill Rack
Daily Challenge Solution
Date : 22/05/2019


ProgramID- 8668

Check All Vowels Present

The program must accept a string S. The program must print yes if all the vowels are present in S as the output. Else the program must print no as the output.
Note: All the alphabets in S are in lowercase.
Boundary Condition(s):
2 <= Length of S <= 100
Input Format:
The first line contains S.
Output Format:
The first line contains yes or no.
Example Input/Output 1:
Input:
tramiorue
Output:
yes
Explanation:
All the five vowels (aeiou) are present in tramiorue.
Hence yes is printed.
Example Input/Output 2:
Input:
rectangle
Output:
no

Solution :
__________________________________________________________________
**Don't copy this same , While copying please change the variables , Otherwise you will be suffer ** __________________________________________________________________
#include<stdio.h>
#include <stdlib.h>

int main()
{
    char s[100],vowels[5]={'a','e','i','o','u'};
    int count=0;
    scanf("%s",s);
    for(int i=0;i<5;i++)
    {
        int present=0;
        for(int j=0;s[j]!=NULL;j++)
        {
            if(s[j]==vowels[i])
            {
                present=1;
            }
        }
        if(present==0)
        count++;
    }
    if(count==5)
    {
        printf("yes");
    }
    else
    {
        printf("no");
    }
}
__________________________________________________________________
**Don't copy this same , While copying please change the variables , Otherwise you will be suffer ** __________________________________________________________________

Saturday 18 May 2019

Skill Rack Daily Challenge Solution Date : 18/05/2019

Skill Rack
Daily Challenge Solution
Date : 18/05/2019


ProgramID- 8637

Characters - Factors of Length

The program must accept a string S as the input. The program must calculate the length of string S as L. Then the program must print the characters which are present at the positions of the factors of L in ascending order as the output.
Boundary Condition(s):
1 <= Length of S <= 100
Input Format:
The first line contains the string S.
Output Format:
The first line contains the characters based on the above conditions.
Example Input/Output 1:
Input:
skillrack
Output:
sik
Explanation:
The length of the string "skillrack" is 9.
The factors of 9 are 1, 3 and 9.
So the characters present at the positions 1, 3 and 9 are printed.
Hence the output is sik
Example Input/Output 2:
Input:
google
Output:
gooe
Solution:
__________________________________________________________________
**Don't copy this same , While copying please change the variables , Otherwise you will be suffer ** __________________________________________________________________

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

int main()
{
    char s[100];
    int length;
    scanf("%s",s);
    length=strlen(s);
    for(int i=1;i<=length;i++)
    {
        if(length%i==0)
        {
            printf("%c",s[i-1]);
        }
    }
    return 0;
}

__________________________________________________________________
**Don't copy this same , While copying please change the variables , Otherwise you will be suffer ** 

Thursday 16 May 2019

Skill Rack Daily MCQ Answer and Solution Date - 16/05/2019

Skill Rack
Daily MCQ Answer and Solution
Date : 16/05/2019


REFID: 33883

R started a business with Rs.28000 and is joined later by V with Rs.48000. After how many months did V join if the profits at the end of the year were divided equally?

Answer : 5 months

Solution:

Suppose V joined after x months
then,
28000*12=48000*(12-x)
=>x=5
answer is 5 months

Skill Rack Daily Challenge Solution Date - 16/05/2019

Skill Rack
Daily Challenge Solution
Date : 16/05/2019


ProgramID- 8629

Zig-Zag from Top Right

The program must accept an integer N as the input. The program must print the desired pattern as shown in the Example Input/Output section.
Boundary Condition(s):
1 <= N <= 50
Input Format:
The first line contains the value of N.
Output Format:
The first N lines containing the desired pattern as shown in the Example Input/Output section.
Example Input/Output 1:
Input:
4
Output:
4 3 2 1
5 6 7 8
12 11 10 9
13 14 15 16
Example Input/Output 2:
Input:
3
Output:
3 2 1
4 5 6
9 8 7

Solution:
_____________________________________________________

**Don't copy this same , While copying please change the variables , Otherwise you will be suffer **
_____________________________________________________


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

int main()
{
    int n,i,j,number=1,matrix[50][50];
    scanf("%d",&n);
    for(i=0;i<n;i++)
    {
        if(i==0||i%2==0)
        {
            for(j=n-1;j>=0;j--)
            {
                matrix[i][j]=number;
                number++;
            }
        }
        else
        {
            for(j=0;j<n;j++)
            {
                matrix[i][j]=number;
                number++;
            }
        }
    }
    for(i=0;i<n;i++)
    {
        for(j=0;j<n;j++)
        {
            printf("%d ",matrix[i][j]);
        }
        printf("\n");
    }
    return 0;
}
_____________________________________________________
**Don't copy this same , While copying please change the variables , Otherwise you will be suffer **

Tuesday 14 May 2019

Skill Rack Daily MCQ Answer and Solution Date - 14/05/2019

Skill Rack
Daily MCQ Answer and Solution
Date : 14/05/2019


REFID: 33886

The number which when multiplied by 23 increases by 1936, is

 Answer : 88

Solution :


Let the number be x
So acc to ques

23x = x+1936
22x = 1936
X = 1936 / 22

X = 88
answer is 88

Skill Rack Daily Challenge Solution Date - 14/05/2019

Skill Rack
Daily Challenge Solution
Date : 14/05/2019



ProgramID- 7680
Check Repeated Alphabets

The program must accept a string value S as the input. The program must print invalid if the alphabets are repeated continuously for more than two times. Else the program must print valid as the output.
Boundary Condition(s):
3 <= Length of S <= 100
Input Format:
The first line contains the values of string S.
Output Format:
The first line contains either invalid or valid.
Example Input/Output 1:
Input:
dreaaam
Output:
invalid
Explanation:
In dreaaam, a is repeated more than two times continuously.
Hence the output is invalid
Example Input/Output 2:
Input:
skillrack
Output:
valid
Solution :
________________________________________________________

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

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

Tuesday 7 May 2019

Skill Rack Daily MCQ Answer and Solution Date - 08/05/2019

Skill Rack
Daily MCQ Answer and Solution
Date : 08/05/2019

REFID: 40091

The average of 5 numbers is 65. The average of the first two numbers is 81 and the average of the last two numbers is 38. What is the third number?

Answer : 87

Solution :

the total for 5 numbers = 65x5=325
total for first two numbers=81x2=162
total for last two numbers=38x2=76
hence third number = 325-(162+76)=87

Monday 6 May 2019

Skill Rack Daily MCQ Answer & Solution Date - 06/05/2019

Skill Rack
Daily MCQ Answer & Solution
Date : 06/05/2019


REFID: 40426

If the perimeter of a square is equal to the radius of a circle whose area is 39424 sq cm, what is the area of the square?

Answer : 784 sq cm

Solution :

Let radius of circle be R cm.
Area of circle = 39424

πR² = 39424

R² × 22/7 = 39424 

R² = ( 39424 × 7 /22 )

R² = 12544

R = √12544

R = 112 cm.

Radius of circle ( R ) = 112 cm.


Given that : Perimeter of square is equal to the Radius of circle whose area is 39424 cm².


Therefore,


Perimeter of circle = 112 cm.

4 × Side = 112

Side = 28 cm 

Area of square = (Side)²

=> (28)² cm²

=> 784 cm².
Answer is 784 sq cm.


Wednesday 1 May 2019

Skill Rack Daily Challenge Solution Date - 01/05/2019

Skill Rack

Daily Challenge Solution

Date : 01/05/2019


ProgramID- 8539

Distance Travelled + or -

The program must accept a string S representing the direction of movement as the input. The string S contains only the characters + and -. A boy moves 1 unit left side if the character in S is -. The boy moves 1 unit right side if the character in S is +. The program must print the distance between the starting position of the boy and the final position at the end of the string as the output.
Boundary Condition(s):
1 <= Length of S <= 1000
Input Format:
The first line contains the string S.
Output Format:
The first line contains the distance between the starting and final position of the boy.
Example Input/Output 1:
Input:
-+++-
Output:
1
Explanation:
The first character is - so he moves 1 unit towards his left.
The second character is + so he moves 1 unit towards his right so he reaches the starting position again.
The third character is + so he moves 1 unit towards his right. Now he is 1 unit away from the starting position.
The fourth character is + so he moves 1 unit towards his right. Now he is 2 units away from the starting position.
The fifth character is - so he moves 1 unit towards his left. Now he is 1 unit away from the starting position.
So the output is 1.
Example Input/Output 2:
Input:
+++++-
Output:
4

Solution:
__________________________________________________________

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

int main()
{
    char s[1000];
    int position=0;
    scanf("%s",s);
    for(int i=0;s[i]!=NULL;i++)
    {
        if(s[i]=='+') position++;
        else position--;
    }
    printf("%d",abs(position));
}
__________________________________________________________