You are on page 1of 2

REM Program to print the short form of the name

CLS
INPUT "Enter your first, middle and last name "; n$
b$ = UCASE$(MID$(n$, 1, 1))
w$ = w$ + b$ + "."
a$ = a$ + b$
FOR i = 2 TO LEN(n$)
b$ = UCASE$(MID$(n$, i, 1))
IF RIGHT$(a$, 1) = " " THEN w$ = w$ + b$ + "."
a$ = a$ + b$
NEXT
PRINT w$
END

4. Display the entered word (s) in abbreviated form (esp. full name)
CLS
INPUT “enter your full name”;N$
PRINT LEFT$(N$, 1)
FOR I = 2 to LEN(N$)
LET X$ = MID$(N$, I , 1)
IF X$ = “ ” THEN PRINT MID$(N$, I + 1, 1); “.”;
NEXT I
END

First letter capital

str=['this is a TEST'];
for i=1:length(str);
if str(1,i(1));
str= upper(str);
else str(1,i);
str= lower(str);
end
end

You might also like