Flowchart Logic 047

 Coding Problem Keys 

 Flowchart Logic 047 

 Problem Statement 

Please fill in the lines of code to implement the logic present in the flowchart.

 Example Input/Output 1 

 Input 

18 4 10

 Output 

1 2 11 13 14 16 17

 Note: Max Execution Time Limit: 50 millisecs 

 Solution 

 Programming Language: Python 3 Language 

N,X,Y=map(int,input().split())
ctr=1
while(ctr<=N):
    if((ctr<X or ctr>Y) and ctr%3!=0):
        print(ctr,end=" ")
    ctr+=1

# Published By PKJCODERS

 Programming Language: C Language 

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

int main() {
    int N,X,Y;
    scanf("%d%d%d",&N,&X,&Y);
    int ctr=1;
    while(ctr<=N){
        if((ctr<X || ctr>Y) && ctr%3!=0){
            printf("%d ",ctr);
        }
        ctr++;
    }
}

// Published By PKJCODERS

 (Note: Incase If the code doesn't Pass the output kindly comment us with your feedback to help us improvise.) 

Comments

Popular Posts

Highly Profitable Months

Largest Possible Number With Digits

Top Scoring Batsman - TEST ODI 20-20

Minimum Sum of Non-Negative Elements

Print OddEven

String - Vowels Position Sum

Count Embedded Integers in String