Codes 2
Codes 2
#include<iostream>
Int main(){
Cout<<”OUTPUT:”<<endl;
String first=”Raspberry”;
String second=”Pi”;
String third=first+second;
//concatenation using +
String fourth-first.append(second);
Cout<<third<<endl;
10
116
Cout<<fourth<<endl;
Cout<<first.size()<<endl;
Return 0;
13
TERMINAL PORTS
OUTPUT:
RaspberryPi RaspberryPi
11
13
+ in 17
#include<iostream>
Cout<<”OUTPUT:”<<endl;
String greet=”Hello”;
Cout<<greet[0]<<endl;
Cout<<greet<<endl; return 0;
8
10
11
PROBLEMS
OUTPUT
PORTS
OUTPUT:
Hello
Fello
3..
#include<iostream>
Int main(){
6
7
10 }
String fullname;
Cout<<”OUTPUT:”<<endl;
Getline(cin, fullname);
PROBLEMS
OUTPUT
DEBUG CONSOLE
TERMINAL PORTS
OUTPUT:
10
11
44
#include<iostream>
#include<cmath>
Using namespace std;
Int main()
PROBLEMS
OUTPUT
DEBUG CONSOLE
TERMINAL PORTS
OUTPUT:
12
1.09861
12
5.
1 #include<iostream>
Cout<<”OUTPUT:”<<endl;
Int main(){
5
6
10}
PROBLEMS
Int time=17;
Cout<<result;
Return 0;
Ise }
OUTPUT:
Good day.
2 3 4 in
67899
10
11
12
13
11
4 in
14
15
16
#include<iostream>
Case 1:
Cout<<”Monday”;
Break;
Case 2:
Cout<<”Tuesday”;
Break;
Case 3:
Cout<<”Wednesday”;
Break;
Case 4:
Cout<<”Thursday”;
Break;
Case 5:
Cout<<”Friday”;
Break;
Case 6:
Cout<<”Saturday”;
Break;
17
18
19
20
21
22
23
24
25
26
Default:
27
Cout<<”invalid”;}
28
Return 0;}
Case 7:
Cout<<”Sunday”;
Break;
OUTPUT:
Friday