char str[80];
Which of the following is correct? Group of answer choices
char str[80];
char (80);
ch str[80];
char 80;
string
It is a sequence of characters
getline()
It is a sequence of characters
isspace()
Returns true provided character expression is a whitespace character, such as the blank or newline character, otherwise, returns false.
cin.getline(str,80);
Which of the following is correct? Group of answer choices
Cin.getline(str,80);
cin.getlines(str,80);
cin.Getline(str,90)
cin.getline(str,80);
! is a punctuation character
toupper()
Converts lowercase letter to uppercase
concatenation
It refers to merging of two strings
isupper()
Returns true provided character expression is an uppercase letter otherwise it returns false
Which of the following operator can be used also in strings?
-
>
@
Hello World
error
stod
Which of the following function converts a string to double? Group of answer choices
stof
stoll
stod
stoi
#=
Which of the following operators is not a comparison operator? Group of answer choices
>=
==
<=
#=
string
A header file that handles string in C++
char
Strings are accessed by variables of what type?
NOT Equal
string
What is the identifier given to string class to declare string objects?
to_string
Which of the following function converts a numerical value to string?
tolower
stoi
toupper
to_string
dot . operator
What operator is used to access the members of a structure?
student.name
You need to create an array from a structure named Students, which is correct?
You need to create an array from a structure named Students, which is correct?
Students stud[3];
Students.stud = 3;
Students(3);
students stud -> 3;
yes
Can a structure contain an integer, string and double data type?
struct a_struct {int a;};
Which of the following is a properly defined struct?
struct a_struct {int a;};
struct a_struct int a;
struct {int a;}
struct a_struct {int a;}
;
\What will be used when terminating a structure?
;
;;
}
:
3
How many members are in this structure?
struct Person
{
char name[50];
int age;
double salary;
};
students.age = 22;
Which of the following statements assigns a value to the age member of students? Group of answer choices
stud.age = 25;
age.student = 22;
students.age = 22;
Students.age = 20;
Person var;
Which properly declares a variable of struct Person? Group of answer choices
string Person;
Person var;
struct var;
Person;
s1.salary
error
What is the output of the program?
int main()
{
structure hotel
{ int items;
char name[10];
}a;
strcpy(a.name, "Neji");
a.items=10;
cout << a.name;
return 0;
}
Student s1,s2;
Which of the following is the correct declaration of a structure variable?
Student s1:s2;
Student s1,s2;
s1,s2= Student ;
Student (s1,s2);
{}
The function body is written inside ___________
Function
It is a block of code to perform a specific task
3
How many members are in this structure?
struct Person
{
char name[50];
int age;
float salary;
};
structure vARIABLE
A ________________ can be passed to a function in similar way as normal argument.
void funtion
It is simply a function that doesn't need to return anything
doesn't have any parameters
The empty parentheses in a function means that it _______________
overloaded function
Two or more functions having the same name but different argument(s)
argument
What is the purpose of p from the following code?
void displayData(Person p)
{
cout << "\nDisplaying Information." << endl;
cout << "Name: " << p.name << endl;
cout <<"Age: " << p.age << endl;
cout << "Salary: " << p.salary;
}
ctype.h
This header declares a set of functions to classify and transform individual characters.
TEST STRING.
9 1 4
tolower()
It returns the lowercase version of a character expression:
strcpy()
Which of the following is a cstring function? Group of answer choices
fabs()
sqrt()
abs()
strcpy()
HELLO WORLD!
strlen()
It returns the length of a string
iscntrl()
Check if a character is a control character
both append and operator +=
Which method do we use to append more than one character at a time?
data
operator +=
both append and operator +=
append
1
word is found at index 10
H
Hello World
5
A member
Check the given structure:
struct Person
{
string name;
int age;
float salary;
};
The salary is :
structure
It is a collection of variables of different data types under a single name
Person s1, s2;
If you have a structure named Person, how can you create a structure variable named s1 and s2?
yes
Can you place an array inside a structure?
Person p1;
Check on the given structure:
struct Person
{
char name[50];
int age;
float salary;
};
If you will create an instance of the structure named p1, what would be the command?
Structure variable
\The instance of the structure is known as:
true
A structure variable can be passed to a function in a similar way as a normal argument
Person p,q;
60
void function
Which of the following functions does not use a return statement? Group of answer choices
int temp (int a)
Void Function
double sales (double x, double y, double x)
int add (int x, int b)
create an array of structure
What does struct Point arr[5]; do?
variable
What is the purpose of s from the following code?
void displayData(Student s)
{
cout << "\nDisplaying Information." << endl;
cout << "Name: " << s.name << endl;
cout <<"Age: " << s.course << endl;
}