Need help with this code?
I'm suppose to write a user friendly programme using functions and modules to accept six names from a user and print to the screen the six names then ask the user which name they want deleted then print the remaining names after the name is deleted then notify the user which name was deleted.
This is what i have come up with thus far.
#include<stdio.h>
char main()
{
int remove;
char names[200];
int myarray[5];
int count;
int bat;
int pie;
int egg;
int name;
count =0;
printf("Please enter 6 names");
scanf("%s",&names);
for(int count=0;count<=5;count++)
scanf("%s",&name);
myarray[count]=name;
for(char bat=0; bat<=5; bat++)
{
printf("%s",myarray[bat]);
printf(" ");
}
printf("Which name would you like deleted?\n");
scanf("%s",&pie);
for(char egg=0; egg<=5; egg++)
{
if (myarray[egg]!=pie)
{
printf("%s",myarray[egg]);
printf(" ");
}
}
return 0;
|