Trying to get name to print in the display

12 ビュー (過去 30 日間)
Steven Lucas
Steven Lucas 2019 年 3 月 20 日
回答済み: madhan ravi 2019 年 3 月 20 日
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

回答 (1 件)

madhan ravi
madhan ravi 2019 年 3 月 20 日
%s

カテゴリ

Help Center および File ExchangeAuthor Block Masks についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by