%%
clc,clear
product=input('Quantity of product you have bought today: ');
for a=1:product
food=input('Why is food so tasty?: ','s');
end
for a=1:product
fprintf('\nBecause it is %s \n',food)
end
****************************************************************************************************************
Quantity of product you have bought today: 2
Why is food so tasty?: idk
Why is food so tasty?: dk
Because it is dk <-----this one suppose to be idk
Because it is dk
>>
1 Comment
Direct link to this comment
https://in.mathworks.com/matlabcentral/answers/720774-is-it-possible-to-make-a-loop-where-the-the-result-is-separate-from-the-loop-and-have-the-result-res#comment_1271749
Direct link to this comment
https://in.mathworks.com/matlabcentral/answers/720774-is-it-possible-to-make-a-loop-where-the-the-result-is-separate-from-the-loop-and-have-the-result-res#comment_1271749
Sign in to comment.