Answer to Question #103618 in C++ for Abdulkadir

Question #103618
Q1.Write down the ouput of the following statements
* cout <<s.subsstr(1, 3)
* .cout <<s+s1. substr (4,12)
*.cout <<s.erase (2,5)
Q2. a.what is type casting in C++
b.with good examples explain how integer data types can be type- cast into real numeric data types and vice versa
1
Expert's answer
2020-02-24T10:54:47-0500

1)

As you have not provided the string so I am considering it as s="abcdefghijklmonpqrstuvwxyz".

cout <<s.subsstr(1, 3) =bcd

cout <<s+s1. substr (4,12) =abcdefghijklmonpqrstuvwxyzefghijklm

cout <<s.erase (2,5) =abghijklmnopqrstuvwxyz


2)

a) Type casting refers to changing an variable of one data type into another. The compiler will automatically change one type of data into another if it makes sense. For instance, if you assign an integer value to a floating-point variable, the compiler will convert the int to a float




Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

Abdulkadir
24.02.20, 18:59

Thanks so much for the great work

Leave a comment

LATEST TUTORIALS
New on Blog
APPROVED BY CLIENTS