Flowchart Logic 065
Coding Problem Keys
Flowchart Logic 065
Problem Statement
Please fill in the lines of code to implement the logic present in the flowchart.
Example Input/Output 1
Input
8 30 9
Output
9 19 20
Example Input/Output 2
Input
16 49 3
Output
23 30 31 32 33 34 35 36 37 38 39 43
Note: Max Execution Time Limit: 50 millisecs
Solution
Programming Language: Python 3 Language
x,y,d=map(int,input().split())
while(x<=y):
temp=x
while(temp>0 and temp%10!=d):
temp//=10
if(temp>0 and temp%10==d):
print(x,end=" ")
x+=1
# Published By PKJCODERS
Programming Language: C Language
#include <stdio.h>
#include <stdlib.h>
int main(){
int x,y,d,temp=0;
scanf("%d%d%d",&x,&y,&d);
while(x<=y){
temp=x;
while(temp>0 && temp%10!=d){
temp/=10;
}
if(temp>0 && temp%10==d){
printf("%d ",x);
}
x++;
}
}
// Published By PKJCODERS
(Note: Incase If the code doesn't Pass the output kindly comment us with your feedback to help us improvise.)
Comments