Advertisement
Guest User

Untitled

a guest
Dec 8th, 2019
98
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
MatLab 0.24 KB | None | 0 0
  1. % Programming Challange
  2. clc;clear;close all;
  3.  
  4. usr_input=input("What string would you like to reverse?\n","s");
  5. q=1;
  6. for n=length(usr_input):-1:1
  7.     rev(q)=usr_input(n);
  8.     q=q+1;
  9. end
  10. fprintf("The reverse of %s is %s.\n",usr_input,rev);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement