Search This Blog

Saturday 29 June 2019

Skill Rack Daily Challenge Solution Date - 29/06/2019

Skill Rack
Daily Challenge Solution
Date : 29/06/2019

ProgramID- 7656

Right Triangle with Asterisk Pattern


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 <= 1000
Input Format:
The first line contains the integer N.
Output Format:
The first N lines contain the desired pattern as shown in the Example Input/Output section.
Example Input/Output 1:
Input:
4
Output:
1
2*3
4*5*6
7*8*9*10
Example Input/Output 2:
Input:
7
Output:
1
2*3
4*5*6
7*8*9*10
11*12*13*14*15
16*17*18*19*20*21
22*23*24*25*26*27*28

Max Execution Time Limit: 2000 millisecs


Solution :
______________________________________________________

#include <stdio.h>

int main()
{
    int num,count=1;
    scanf("%d",&num);
    for(int i=0;i<num;i++)
    {
        for(int j=0;j<=i;j++)
        {
            if(j!=0)printf("*");
            printf("%d",count++);
        }
        printf("\n");
    }
    return 0;
}
______________________________________________________

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 **