Trying to get name to print in the display

15 views (last 30 days)
Steven Lucas
Steven Lucas on 20 Mar 2019
Answered: madhan ravi on 20 Mar 2019
Code:
Name = input('Enter your name: ','s');
fprintf('Hello, %13.0s, this program will let you mix two primary colors\n yellow, red, and blue together to make a secondary color.\n\n',Name);
color1=input('Enter the first color to mix: ','s');
fprintf('\n')
color2=input('Okay, %13.0s, now enter the second color to mix: ','s');
fprintf('\n')
Output:
Enter your name: steve
Hello, , this program will let you mix two primary colors
yellow, red, and blue together to make a secondary color.
Enter the first color to mix: red
Okay, %13.0s, now enter the second color to mix: brown

Answers (1)

madhan ravi
madhan ravi on 20 Mar 2019
%s

Categories

Find more on Author Block Masks in Help Center and File Exchange

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!