Assign names of your five friends to five different variables. Write a program tp print your friends name in different lines
i need this answer
ace and expects pls help
Answers
Answered by
3
int main(void)
{
char cName[5][21]= {0};
int x=0;
int iPick;
printf("Enter the name of 5 people\n\n");
for(x=0;x<=5;x++){
printf("Enter name %d:", x+1);
scanf("%s", cName[x]);
printf("\n\nWould you like to add another name or view current names stored?\n");
printf("1)\tAdd another name\n");
printf("2)\tView names stored\n");
scanf("%d", &iPick);
switch(iPick){
case 1:
break;
case 2:
for(x=0;x<=5;x++){
printf("\nName %d is %s\n",x+1, cName[x]);
}
}
}
return 0;
}
Answered by
0
Answer:
Answer:
a = "Piyush"
b = "Monu"
c = "Himanshu"
d = "Raj"
e = "Nikita"
print (a)
print (b)
print (c)
print (d)
print (e)
Similar questions