How to print a value from a string ?

Suppose xyz is a variable which value  xyz={abcdefghijksefjg}
so, how to print 'd' from xyz value?
At first count the position of every value
If we count the value from ending position so,we can count as below


So we can write this program as 
For reverse method:

Output:


How to print 'put' from 'computer'?

At first count the position 'p' and 't' then type the print command as  (starting position : ending position+1). This method call selecting sub sequences from strings.


Output:

0 comments :

Post a Comment

Cancel Reply

computer books list list of computer science books with authors best computer books for beginners fundamental of computer books pdf free download computer books for dummies best computer hardware books introduction to computer best computer books of all time

Powered by Blogger.

Followers

Search This Blog

Translate