Posts

Concepts in c++........

Image
  Concepts in c++                                                                                   And I choose the topic for today is the concepts of c++  and first of all i will make the list for all of them than i will tell little bit about them should we start from here? I think no. We should understand the overview first that what is c++ why i am talking about the c++ so the answer of it is this that c++ is a programming language which is the fastest programming language and can access the hard of computer directly this is the reason this is the fastest language uses to make the software,games, management systems and games etc. So the topics of this language are these: 1)Introduction to c++ 2)Data types 3)header-files 4)Rules 5)if-else/if-else-if/if statements 6)loops(for,while,do-while) 7)Arrays 8)Functions(build-in+user-define) 9)Structures 10)File-Handling 11)string 12)Other vocabulary of c++ 13)Vectors                         So, why i talked about these topics so the answer

How to start programming.....

Image
 How to start Programming                             So First of all to start programming there is only thing which need is a fresh mind which every human contain. In this era there is nothing difficult to learn because in this era there is a thing which makes everything easy to learn which is internet. In this time we can afford internet easily and it is easiest way to learn in minimum cost.Therefore, we should learn something to grow yourself and start with programming is a big deal because in this time programming or coding is very important. Our world need good programmers to grow in science because after humans robots are introduced to work and to make work for them we need programming to program their computers. This can make the life easier for humans because in this way humans will get less burden of work. So, whatever after make our mind we should plan which language we should start. which language we should start:                                                              

This article can save your life

Image
 This article can save your life   In times of disaster most people fail to do the important work that can save their lives. But why does this happen? While searching for the answer, one should pay attention to the incident of September 27, 1994 in which 852 people drowned at sea. At seven in the morning that day, the ship MS Estonia departed from Tallinn port with 989 passengers. He had to cross the Baltic Sea to Stockholm. But the ship never got there. Six hours after leaving port, the ship was caught in a severe storm, its front door shattered and water began to seep in. Within an hour, the ship sank, along with 852 passengers and crew. Why 852 people drowned? The pace of the tragedy, the hurricane, the declaration of emergency half an hour after the sinking and the time for the rescue team to reach the affected people ... Despite all these, the relief experts were stunned by the death of so many people. It seems that many people drowned simply because they made no attempt to escape

Program to check odd or even number in c++ programming language

#include<iostream> using namespace std; int main() { int a; cout << "enter the value of a:"; cin >> a; if (a % 2 == 0) cout << "this number is even"; else cout << "this number is odd"; getchar(); getchar(); return 0; }

Program to check first digit between two digits that is it odd or even number

#include<iostream> using namespace std; int main() { int a,rem,rev=0; cout << "Enter the value for a:"; cin >> a; while (a!=0) { rem = a % 10; rev = rev * 10 + rem; a = a / 10; } if (rev % 2 == 0) cout << "It is even"; else cout << "It is odd"; getchar(); getchar(); return 0; } //(with easy way) #include<iostream> using namespace std; int main() { int a,rem,q=0; cout << "Enter the value for a:"; cin >> a; q = a / 10; if (q % 2 == 0) cout << "It is even"; else cout << "It is odd"; getchar(); getchar(); return 0; }

Program to find Arithmetic Mean using c++ programming language.

#include<iostream> using namespace std; int Mean234(int a, int b); int Mean234(int a, int b, int c); int Mean234(int a, int b, int c, int d); int main() { double a, b, c, d; cout << "Enter two values :" << endl; cin >> a >> b; cout << Mean234(a, b) << endl; cout << "Enter three values :" << endl; cin >> a >> b >> c; cout << Mean234(a, b, c) << endl; cout << "Enter four values :" << endl; cin >> a >> b >> c >> d; cout << Mean234(a, b, c, d) << endl; return 0; } int Mean234(int a, int b) { cout << "Arithmetic Mean is :"; return((a + b) / 2.0); } int Mean234(int a, int b, int c) { cout << "Arithmetic Mean is :"; return((a + b + c) / 3.0); } int Mean234(int a, int b, int c, int d) { cout << "Arith

Selecting Sorting

// Sorting without using function: #include<iostream> using namespace std; int main() { int size; int arr[20], temp, loc, min; cout << "Enter the size of array:"; cin >> size; for (int i = 0; i < size; i++) { cout << "Enter the values of array:"; cin >> arr[i]; } for (int i = 0; i < size - 1; i++) { min = arr[i]; loc = i; for (int j = i + 1; j < size; j++) { if (arr[j] < min) { min = arr[j]; loc = j; } } temp = arr[i]; arr[i] = arr[loc]; arr[loc] = temp; } for (int i = 0; i < size; i++) { cout << "Array elements after selction is:"; cout << arr[i] << endl; } getchar(); getchar(); return 0; } //Sorting with using function: #include<iostream> using namespace std; void values(int arr[20], int); const int size = 5; int main() { int arr[size]; for (int i = 0; i < size; i++) { cout &

Bubble Sorting

  //Sorting without using functions: #include<iostream> using namespace std; int main() { int size; int arr[20], temp, swap; cout << "Enter the size of array:"; cin >> size; for (int i = 0; i < size; i++) { cout << "Enter the values of array:"; cin >> arr[i]; } for (int i = 1; i < size; i++) { swap = 0; for (int j = 0; j < (size-i); j++) { if (arr[j] < arr[j+1]) { temp = arr[j]; arr[j] = arr[j+1]; arr[j + 1] = temp; swap = 1; } } if (swap == 0) { break; } } for (int i = 0; i < size; i++) { cout << "Array elements after selction is:"; cout << arr[i] << endl; } getchar(); getchar(); return 0; } // Sorting with using function: #include<iostream> using namespace std; void values(int arr[20], int); const int size = 5; int main() { int arr[size]; for (int i = 0; i < size; i++) { cout << "Enter th

How to Start a Business with No Money?

Image
How to Start a Business with No Money?                             Hello, friends,  Today, we will talk about the property business model How can you market your business if you want to do property business Recently, Sandeep Maheshwari ji talked about this thing in his part 2 So today I will talk about the marketing part and I have a lit bit experience of this thing also And till yet in every batch, there was one student who had the same business model So I know what problem will occur while executing it So I have added a few things through which you will always make a profit and never face looses But again I am telling you that you need to check this thing according to yourself I am showing you the path but you have to walk yourself Before starting this video I want to say thank you to Sandeep Maheshwari Ji Because the  position in which where I am now is just because of him If you see my previous videos then my body language was not good enough But personally, I am the same person th

Clippy Game using c++ programming

#include <iostream> #include <conio.h> #include <cstdlib> #include <ctime> #include <string> #include <sstream> using namespace std; void guide(); void body(); void display(char[][9]); // For display of screen void Hint(int); int main() { char choice; body(); cout << "Enter N for new game Q to quit the game"; cin >> choice; if (choice == 'N' || choice == 'n') { system("cls"); body(); } else if (choice == 'q' || choice == 'Q') { exit(0); } } void body() { srand(time(0)); int x, y; int arr[9][9]; string enter; char ar[9][9]{ { '.', '.', '.', '.', '.', '.', '.', '.', '.' }, { '.', '.', '.', '.', '.', '.', '.', '.', '.' }, { '.', '.', '.', '.', '.', &#

Snake Game using c++ programming

#include <iostream> #include<windows.h> //Library used to add sleep function #include<conio.h> #include<stdlib.h> //Library used for random numbers using namespace std; //Taking Global Variables bool gameOver; //Taking constant variables for arena width and height const int width = 20; const int height = 20; //taking an array for the size of snake int tailX[50], tailY[50]; int nTail; //Variables for position of player and fruit int x, y, FruitX, FruitY, score; //Setting enumerators for fixed direction enum eDirection { STOP = 0, LEFT, RIGHT, UP, DOWN }; eDirection dir; void Settings() { //1 //Setting the game to start //Setting gameover to false to start the game gameOver = false; //Setting direction to stop so snake will not be moving at the start of game dir = STOP; //Setting the location of snake at the centre of arena at the start of game x = width / 2; y = height / 2; //using random operator to randomize our fruit in the map FruitX =

Hospital Management System in c++

#include<iostream> #include<string> using namespace std; class Quarentine_Center{ protected: int center_id, quantity_of_bed;int no_of_patients; string location, contact_no; public: Quarentine_Center(int a,int b,int e,string c,string d) { center_id = a; if (b <= 20) { quantity_of_bed = b; } else cout << "Beds are not enough" << endl; if (e <= 20) no_of_patients = e; else cout << "Beds are not enough" << endl; location = c; contact_no = d; } void centerdetail() { cout << "Quantity of beds are:" << quantity_of_bed << endl; cout << "Number of patients are:" << no_of_patients << endl; cout << "Location is:" << location << endl; cout << "Contact number is:" <<contact_no << endl; } }; class Person{ protected: int person_id[20], age[20]; string first_name[20], last_name

Calculator using c++ Programming

#include<iostream> using namespace std; void add(); void subtract(); void divide(); void multiply(); int main() { int a; cout << "Enter 1 for add:" << endl; cout << "Enter 2 for subtract:" << endl; cout << "enter 3 for divide:" << endl; cout << "Enter 4 for multiply:" << endl; cin >> a; if (a == 1) { add(); } if (a == 2) { subtract(); } if (a == 3) { divide(); } if (a == 4) { multiply(); } getchar(); getchar(); return 0; } void add() { int a, b,c; cout << "Enter the 1st value:"; cin >> a; cout << "Enter the 2nd value:"; cin >> b; c = a + b; cout << "Sum is " << c << endl; } void subtract() { int a, b, c; cout << "Enter the 1st value:"; cin >> a; cout << "Enter the 2nd value:"; cin >> b; c = a - b; cout << "Subtr

Quiz Game in c++ Programming

#include<iostream> #include "stdio.h" #include<string> #include<conio.h> using namespace std; int start(); int rule(); int history(); int main() { int v; cout << "\n\n\t\t\t * Quiz Game *"; cout << "\n\n\t\t\t *************"; cout << "\n\n\t\t=============================================================="; cout << "\n\n\t\tDeveloped By :Faisal Abdul Ghani , Abdul Wahab And Bilal zahid "; cout << "\n\n\t\t=============================================================="; cout << "\n\n"; cout << " press 1 for play \n press 2 for setting \n press 3 to exit the game"; cin >> v; if (v == 1) { start(); } } int start() { int c, n; char name[100]; cout << "\n Please Enter Your Name : "; cin >> name ; cout << "\n\n"; cout << "\n\n\t\t Welcome " << name &l

Ticket Management System in c++

#include<iostream> #include<fstream> #include<string> using namespace std; struct Data { int tickets; int id; int seats; string airline, place; string choose; string Fname; string Lname; string passportNo; string CNIC; }; ofstream seat; ofstream name; ofstream cancel; ifstream full; Data a, b[200]; void data(); void internatinal(); void local(); void getData(); void seatsData(); void ticket(); void aboutUs(); int main() { int x; cout << " ==============================================" << endl; cout << " ---------AIRWAYS RESERVATION----------------" << endl; cout << " ---------- MAIN MENU---------------- " << endl; cout << " ---------ENTER YOUR CHOICE------------" << endl; cout << endl; cout << endl; cout << endl; cout << " PR