#include <stdio.h>
#include <string.h>
void enterdata(int
y[], int size){
int i;
while(1){
printf("Enter choice:
");
scanf("%d",&i);
if(i<=5701||i>=5709)
break;
else{
printf("Re-enter choice\n");
switch (i){
case
5701:
printf("Red\n:");
break;
case 5202:
//something
happen
break;
//default: write it if you
need
}
}
}
for(int j=0; j<size;
j++){
scanf("%d",&y[j]);
}
}
int main()
{
int
y;
//...
char colours[9] ={'#','0','x','f','f','f','f','f','f'};
int
x=0;
printf("Enter choice:
");
scanf("%d",&y);
if(y>=5701||y<=5709) //you need to use
"&&" instead "||" for [5701;5709]
printf("Choice
Available:%d\n",enterdata);
if(y<5701||y>5709)
printf("Choice
Not Available:%d\n",enterdata);
if(x!=-1)
printf("Colour
Found:%s",colours);
if(x==-1)
printf("Colour Not
Found:%s",colours);
//...
return 0;// programm end successfully
}
Comments
Leave a comment