Loading....
Coupon Accepted Successfully!

 

Question-1

Define library.

Solution:
A library is a collection of subprograms used to develop other programs and software.

Question-2

What are header files?

Solution:
The C++ standard library contains files containing the standard functions that our program may use. These files are known as header files.

Question-3

Define stdio.h .

Solution:
This is a standard input output package which stores the functions which are needed to perform input output operation.

Question-4

List some stdio.h functions.

Solution:
The functions of stdio.h are ferror, fscanf, fwrite, putw etc.

Question-5

What is the need for math function?

Solution:
Math function is used to declare the prototypes for the mathematical function and math error handlers. The routine in math.h performs mathematical calculation and conversion.

Question-6

List the math function of C++.

Solution:
The math functions available in C++ are acos, atan, fabs, sqrt, div, exp etc.

Question-7

Give the syntax for isdigit() function.

Solution:
The syntax of isdigit() is

int isdigit(int ch); // where isdigit checks whether the given character is a digit or not.

 

Question-8

List some of the string functions.

Solution:
The string functions available in C++ are strcat(), strlen(), strcpy(), strcmp() etc.

Question-9

Discuss about <iostream.h> in detail.

Solution:
In C++ all devices are treated as files. Thus the standard input devices, standard output devices and the standard error device are all treated as files. At its lowest level, a file is interpreted simply as a sequence, or a stream of bytes. At this level the notation of a data type is absent i.e., data is treated simply as sequence of bytes without considering its data type. However, at the user level, a file consists of a sequence of possibly intermixed data types-characters, arithmetic characters and class objects.

Question-10

Write a program to read two strings and appends the first string to the second.

Solution:
#include<iostream.h>

#include<conio.h>

#include<string.h>

main()

{

char s[10], s1[10];

cout<<"\n enter the first string \n;

cin.getline(s,10);

strcat(s1,s);

int len= strlen(s1);

cout.write(s1.len);

}

Question-11

Explain tolower() function.

Solution:
This function is used to convert its argument to lowercase letter if its argument is a letter.

Question-12

Write a program to show the application of random function.

Solution:
#include<iostream.h>

#include<conio.h>

main()

{

randomize();

int num, rndum;

cin >> num;

rndum = random(num) + 7;

for ( int n=1;n<=rndum; n++)

cout << n<< " " ;

}

Question-13

What is the purpose of using pow() and exp() function.

Solution:
Pow() function is used to find the power of the given number.

Exp() function is used to find the value of e raise to the power value.

Question-14

Give the syntax for strcmp() function

Solution:
The syntax for strcmp() function is

Int strcmp(const char *str1, const char *str2);)

Question-15

Write the functions used to perform random function.

Solution:
The functions used to perform random data are rand(), srand(), random() and randomize().




Test Your Skills Now!
Take a Quiz now
Reviewer Name