GoConqr has a new look! Let us know what you think.

Notes

Untitled

nethmi shehara English 1 page

Content of the notes (1)

Page 1

c ++

1) boolean name bool isittrue=true;

2) concatenate concatenate add two strings (+)

3) use the correct function to print the length of the txt string.se the correct function to print the length of the txt string

( string text ="Hello"

cout << txt.length(); )

4) Access the first character (H) in myString and print the result:Access the first character (H) in myString and print the result:

string myString = "Hello";

cout<<myString[0];

5) in string use single qutoes

6)Use the correct function to read a line of text which is put in by the user.Use the correct function to read a line of text which is put in by the user.

string fullName;

cout << "Type your full name: ";

getline (cin, fullName);

cout << "Your name is: " << fullName;

7)Use the correct function to print the highest value of x and y.Use the correct function to print the highest value of x and y

int x = 5; int y = 10;

cout<<max(x,y) // like m you can use round also

7) header file in c++ s ( cmath )

8)Fill in the missing parts to print the value true (for true):Fill in the missing parts to print the value true (for true):\

int x = 10; int y = 9;

cout <<(x>y);

9) (ternary operator):(ternary operator):if else

int time = 20;

string result =(time < 18) ? "good day" : "Good evening.";

cout << result;

Information

Description
Note on Untitled, created by nethmi shehara on 27/09/2023.
Created by
nethmi shehara · Sep 2023
Updated
Sep 27, 2023
Views
1
Rating

Feedback

What is it about?

What do you think of the new look?

How do you like it?