Answer to Question #7241 in C++ for Andretti Rupert

Question #7241
Can u please assist me in fixin this program? #include <stdio.h> #include <string.h> main() { void enterdata(int y[]); int y; int i=0; int choice; void searchdata(int x[]); char paint [9]; char colours [9]; char search[9]; int colour_no; int r; int x=0; if(y>=5701||y<=5709) printf("Choice Available:%d",enterdata); if(y<5701||y>5709) printf("Choice Not Available:%d",enterdata); if(x!=-1) printf("Colour Found:%s",colours); if(x==-1) printf("Colour Not Found:%s",colours); } void enterdata(int y[]){ int i; if(i>=5701||i<=5709) { printf("Enter choice"); scanf("%d%",i); } else(i<5701||i>5709); printf("Re-enter choice:"); { if(i==5701) { printf("Red\n:"); } if(i==5702)
1
Expert's answer
2012-03-13T08:05:49-0400
#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

}

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be first!

Leave a comment

Ask Your question

LATEST TUTORIALS
New on Blog
APPROVED BY CLIENTS
paypal