How can i write with using for?

Incorporate and modify the "if" inside your "for", to check if a date is before, after or equal 2019.
year = input('enter a year:');
if(year>2019)
fprintf('year is after 2019.\n');
elseif(year<2019)
fprintf('year is before 2019.\n');
else
fprintf('year is equal to 2019.\n');
end

2 件のコメント

KALYAN ACHARJYA
KALYAN ACHARJYA 2019 年 12 月 28 日
Are you rerun the code again and again?
Image Analyst
Image Analyst 2019 年 12 月 28 日
I'm not sure what your question is. Your homework gave you an instruction and so you did it, so what's your question?
You forgot to give your for loop, which it sounds like is supposed to exist before you add this modification you just posted because it said "inside your "for"", so you should already have that for loop.

回答 (0 件)

この質問は閉じられています。

質問済み:

2019 年 12 月 28 日

閉鎖済み:

2021 年 8 月 20 日

Community Treasure Hunt

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

Start Hunting!

Translated by