Need a project done?

C++ Programming Developer

Search This Blog

Delete node linked list C++

Delete node linked list C++
Solution:

Linked list Insert at nth position C++

//Insert at nth position linked list C++.
//This program inserts every where except the first location i.e. does not insert at head.
Solution:

Linked List Insert at head C++

Insert at head linked list C++
Solution:

Linked List Insert at tail C++

// C++ Linked List Insert at tail
Solution:

Static C++


Static C++:

//What will be its output?
#include <iostream>
using namespace std;

f();

void main(){
f();
f();
f();
}

f(){
static a = 0;
cout << a++ << ' ';
}

Bubble Sort C++

What is Bubble Sort or Bubble Sorting?

In Bubble Sort, we follow following steps:

•Sorting data
–Important computing application
–Virtually every organization must sort some data
•Massive amounts must be sorted

•Bubble sort (sinking sort)
–Several passes through the array
–Successive pairs of elements are compared
•If increasing order (or identical), no change
•If decreasing order, elements exchanged
–Repeat these steps for every element

•Example:
–Go left to right, and exchange elements as necessary
•One pass for each element
–Original:   3  4  2  7  6
–Pass 1:      3  2  4  6  7   (elements exchanged)
–Pass 2:      2  3  4  6  7
–Pass 3:      2  3  4  6  7   (no changes needed)
–Pass 4:      2  3  4  6  7
–Small elements "bubble" to the top (like 2 in this example)

•Swapping variables
int x = 3, y = 4;
y = x;
x = y;
•What happened?
–Both x and y are 3!
–Need a temporary variable

•Solution
int x = 3, y = 4, temp = 0;
temp = x;  // temp gets 3
x = y;     // x gets 4
y = temp;  // y gets 3


Bubble Sorting in C++:

#include<iostream>
using namespace std;

Open Web Page using C++

How to Open Web Page using C++?

#include <windows.h>
int main()
{
ShellExecute(NULL, "open", "http://truefastians.blogspot.com",
NULL, NULL, SW_SHOWNORMAL);
}

Download Videos from any site


Download Torch Browser, and Download Videos from any site by just a single Click.
It's my personal experience.

Pi Recursion C++

The value of π can be determined by the series equation
Ï€=4∗(1-1/3+1/5−1/7+1/9−1/11+1/13…)
Write a program that prompts the user to enter a positive odd number n and uses recursion to approximate the value of Ï€ using the given formula including term up through 1/n.
Solution:

Recursive function to search through array

Recursive function to search through array.

Write a program that asks the user to enter 10 integers, stores these numbers in an array. The program should ask if the user would like to search an element in the array, in which case the program should then prompt the user to enter the number to look for. Use a recursive function find( int index, int target, int array[] ) that does sequential search for a target in this array. Display an appropriate message to the user after searching the element.

Solution:

Palindrome Recursion C++

Write a recursive function of determining whether a string is palindrome or not.
Note: A palindrome is a string that can be read the same both forward and backwards such as racecar, mom etc.

Solution:

Conditional Operator ? : in C++


bool is a data type whose elements can be either 1 or 0.

Recursion Smallest element of array C++

Write a recursive function that finds and returns the minimum or smallest elemnt in an array, where the array and its size are given as parameters.

Solution:

Recursion Question

What will be the output?
#include <iostream>
using namespace std;
void f(int);
int main()
{
 f(2);
 return 0;
}
void f(int n)
{
 if (n == 0)
  cout << n << ' ';
 else
  f(n-1);
}
Reply in comments.

Recursive Power Function C++

Write a function int Power(int a, int b) that calculates the power a^b. You are allowed to use multiplication operator *.
Solution:

Recursive Multiplication using addition

Write a function int Mul(int a, int b) that computes the product of two integers a and b. The only arithmetic operation that you are allowed to use is addition '+'.
Solution:

Recursive function Sum of elements of array

Write a recursive function that computes and returns the sum of all elements in an array, where the array will be created dynamically by getting the size from the user. Array and its size are given as parameters.
Solution:

Recursive function to calculate Sum of all numbers from 1 to n in C++

Write a recursive function in C++ that computes the sum of all numbers from 1 to n, where n is given as parameters.
Solution:
"Don't let anyone ever make you feel like you don't deserve what you want."