4.1 Code Practice
Question 1:
Write a program that asks the user to enter a name, and then print "Nice to meet you NAME". Your program should repeat these steps until the user inputs "Nope".
Answers
Answered by
0
programming in c++....
#include<iostream.h>
#include<conio.h>
#include<iomanip.h>
void main()
{
clrscr();
char St[19];
cout<<"enter the name";
cin.getline(St,19);
cout<<"nice to meet you";
getch();
}
#include<iostream.h>
#include<conio.h>
#include<iomanip.h>
void main()
{
clrscr();
char St[19];
cout<<"enter the name";
cin.getline(St,19);
cout<<"nice to meet you";
getch();
}
Answered by
0
Below are the program in python for the question above:
Explanation:
print("Enter name") #prints enter the name.
st=input() # take inputs from the user.
while(st!='Nope'): # While loop.
print("Nice to meet you"+st) # prints the name with the string defined in the question.
print("Enter name") # render a user instruction to enter the name.
st=input() # take inputs from the user.
Output:
- If the user inputs "srrr" and "Nope" then the program gives output: Nice to meet you srrr.
Code explanation:
- The above program first render a message to enter the name and then name will matched to check that the name is not equal to Nope then the message will print if it is not Nope otherwise the program will terminated.
Learn More:
- Python: https://brainly.in/question/14689905
- Python : https://brainly.in/question/5496569
Similar questions