Friday, March 5, 2021

kamranali

75 POSTS4 COMMENTS

Recursive factorial function in C++

Here we are going to define our recursive factorial function in C++: #include <iostream> using namespace std; int factorial(int n) ...

McCarthy 91 function in C++

McCarthy 91 function is a recursive function used within computer science, its definition is: Now how we implement this McCarthy 91 function in our C++...

Finding Greatest Common Divisor of 2 numbers in C++

As we know that greatest common divisor of 2 numbers is the largest number that divides both those numbers, How we implement this logic...

Binomial Coefficients in C++

How we implement a logic to find out the binomial coefficients of an entered number by the user in C++?. Look at the below...

Area and Perimeter of rectangle in C++

Area and Perimeter both are the mathematical terms used with rectangle, area is the length multiplied by width while perimeter is the length of...

4 Big Mistakes to Avoid When Learning Programming

Here are the 4 big mistakes which you have to avoid while learning programming. 1) Fear and self doubt: I have put this...

C++ inheritance

lets have a look at the below example: // C++ inheritance #include<iostream> using namespace std;   class Point { protected:     int x,y; public:     Point(int ,int);     void display(void); };   Point::Point(int a,int b) {     x=a;     y=b; }   void Point::display(void) {      cout<<"point = "; }   class Circle : public Point {     double radius; public:     Circle(int ,int ,double );     void display(void); };   Circle::Circle(int a,int b,double c):Point(a,b) {     radius = c; }   void Circle :: display(void) {     Point::display();     cout<<" and radius = "<<radius; }   int main(void) {     Circle c(3,4,2.5);     c.display();     cout<<endl;     return 0; } In the above we took a class “point” in which we defined its attributes (its data members...

Creating a Timer in C++

Creating a timer means creating a digital watch, simply. A Digital watch is the one that counts and shows the time in form of...

Program for Palindrome in C++

Palindrome is a word that reads the same forward or backward. Now how can we check a string that it is a palindrome or...

Finding Length of a string in C++

Sometimes we have strings entered by the user and we need to find out the length of a string or size of that length...

TOP AUTHORS

0 POSTS0 COMMENTS
1 POSTS0 COMMENTS
75 POSTS4 COMMENTS
0 POSTS0 COMMENTS
- Advertisment -

Most Read

Android Webview Tutorial With Example | How to Use Webview in Android

Android Webview Tutorial With Example Have you seen an Android app displaying Web content using Webview. This Android Webview Tutorial is about integrating Webview using Android Studio....

Student Registration Project in PHP

In this Student Registration Project we are providing a form in simple html to the student and that form sends the data to "student.php"...

Java GUI Calculator Source Code

Here we have a Java GUI Calculator Source Code for you in which a Java GUI calculator has been created using "swing" and "awt". The calculator has...

Numeric Array in PHP

Numeric arrays can store numbers, strings and any object but their index will be represented by numbers. By default array index starts from zero....