- Trending Categories
Data Structure
Networking
RDBMS
Operating System
Java
MS Excel
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
Physics
Chemistry
Biology
Mathematics
English
Economics
Psychology
Social Studies
Fashion Studies
Legal Studies
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
Found 34494 Articles for Programming
![Arjun Thakur](https://www.tutorialspoint.com/assets/profiles/13574/profile/60_74441-1560315595.jpg)
72 Views
The function log1p() is used to calculate the natural logarithm (base e logarithm) of (a+1) where a is any number. It returns the value of natural logarithm of (a+1). It returns Not a number(Nan) when we pass a value which is less than -1.Here is the mathematical expression of log1p(), log1p(a) = base-e log(a+1)Here is the syntax of log1p() in C++ language, float log1p(float variable_name);Here, variable_name − Any name given to the variable whose logarithmic value is calculated.Here is an example of log1p() in C++ language, Example Live Demo#include #include using namespace std; int main() { int ... Read More
![Ankith Reddy](https://www.tutorialspoint.com/assets/profiles/22328/profile/60_142162-1519038074.jpg)
77 Views
The function frexp() is used to break the floating point number into its binary significand and integral exponent for 2. It returns the binary significand and its range is (0.5, 1). If we pass value zero, its significand and exponent value will be zero.Here is the mathematical expression of frexp(), x = significand * (2^exponent)Here is the syntax of frexp() in C++ language, float frexp(float variable_name, int* exponent);Here, variable_name − Any name of variable which has floating number to be decomposed into binary significant.exponent − It is a pointer to int where value of exponent is stored.Here is an example ... Read More
![George John](https://www.tutorialspoint.com/assets/profiles/13511/profile/60_58410-1512537824.png)
4K+ Views
Error handling is not supported by C language. There are some other ways by which error handling can be done in C language. The header file “error.h” is used to print the errors using return statement function.It returns -1 or NULL in case of any error and errno variable is set with the error code. Whenever a function is called in C language, errno variable is associated with it. errno is a global variable and is used to find the type of error in the execution.The following table displays some errors −Sr.NoErrors & Error value1I/O Error52No such file or directory23Argument ... Read More
![Chandu yadav](https://www.tutorialspoint.com/assets/profiles/22330/profile/60_142811-1519038104.jpg)
208 Views
C++ is a middle-level language. It was developed by Bjarne Stroustrup in 1979. It is just an enhancement to C language and an object-oriented language. C# is modern and object-oriented language developed by Anders Hejlsberg. It is a part of the .NET framework. It is designed for Common Language Infrastructure (CLI). It is also a popular language. Difference between C++ and C# Both languages are object-oriented languages. C++ has low level of abstraction while C# has high level of abstraction. In C++, the program can be coded for any platform while in C#, the program is targeted towards windows ... Read More
![George John](https://www.tutorialspoint.com/assets/profiles/13511/profile/60_58410-1512537824.png)
10K+ Views
Exceptions are the problems which arise at the time of execution of program. It is an event which is thrown at runtime. It protects the code and run the program even after throwing an exception. Exception handling is used to handle the exceptions. We can use try catch block to protect the code.Catch block is used to catch all types of exception. The keyword “catch” is used to catch exceptions.Here is an example of catching all the exceptions in C++ language, Example Live Demo#include using namespace std; void func(int a) { try { if(a==0) throw ... Read More
![Chandu yadav](https://www.tutorialspoint.com/assets/profiles/22330/profile/60_142811-1519038104.jpg)
277 Views
Exception handling is used to handle the exceptions. We can use try catch block to protect the code. Exception can be thrown anywhere within the code block. The keyword “throw” is used to throw an exception.Here is an example of throw in C++ language,Example Live Demo#include using namespace std; int display(int x, int y) { if( y == 0 ) { throw "Division by zero condition!"; } return (x/y); } int main () { int a = 50; int b = 0; int c = 0; try { c = display(a, b); cout
![Ankith Reddy](https://www.tutorialspoint.com/assets/profiles/22328/profile/60_142162-1519038074.jpg)
24K+ Views
There are several methods to check that string is an int or not and one of those method is to use isdigit() to check the string.Here is an example to check whether a string is an int or not in C++ language,Example Live Demo#include #include using namespace std; int main() { char str[] = "3257fg"; for (int i = 0; i < strlen(str); i++) { if(isdigit(str[i])) cout
![George John](https://www.tutorialspoint.com/assets/profiles/13511/profile/60_58410-1512537824.png)
2K+ Views
Left ShiftIn the left shift operator, the left operands value is moved left by the number of bits specified by the right operand.Here is an example of left shift operator in C language,Example Live Demo#include int main() { int y = 28; // 11100 int i = 0; for(i;i
![Arjun Thakur](https://www.tutorialspoint.com/assets/profiles/13574/profile/60_74441-1560315595.jpg)
1K+ Views
The operator ‘?’ is known as ternary operator as it requires three operands to act upon. It can be represented by “ ? : ”. It is also known as conditional operator. The operator improves the performance and reduces the lines of code.Here is the syntax of ternary operator in C language, Expression1 ? Expression2 : Expression3Here is an example of Ternary Operator in C language, Example Live Demo#include int main() { int a = -1; double b = 26.4231; int c = a? printf("True value : %lf", b):printf("False value : 0"); return 0; }OutputHere ... Read More
![Ankith Reddy](https://www.tutorialspoint.com/assets/profiles/22328/profile/60_142162-1519038074.jpg)
4K+ Views
Union is a user-defined datatype. All the members of union share same memory location. Size of union is decided by the size of largest member of union. If you want to use same memory location for two or more members, union is the best for that.Unions are similar to structures. Union variables are created in same manner as structure variables. The keyword “union” is used to define unions in C language.Here is the syntax of unions in C language, union union_name { member definition; } union_variables;Here, union_name − Any name given to the union.member definition − Set of member ... Read More