Skip to main content

Posts

Showing posts from 2017

Education System of Pakistan is Not according to current Challenges

Education is the primary need of any country and no one can deny from its importance. An up to mark  education system is much important for every country. Now a days we have much more facilities which we have not in the past like mobile phones, leds, luxury houses and cars it’s all just due to advancement in technology that is just due to education. Unfortunately, like other third world countries in Pakistan education system is not up to date per current requirement and upcoming challenges.  Like Pakistan is far behind as compared to its neighbor country lndia  which has much advance education system and have high ranked universities of IT and Energy related field that are directly linked to industries. The education system in Pakistan is as old as Pakistan itself. No one pays serious attention to change the educational system. We are reading books which were published many years ago and there is no changings in the books. Even in universities Pakistani students do p...

Jeeto Pakistan Show Essay

Jeeto Pakistan Jeeto Pakistan is a popular and successful show  world wide. It is on aired twice a weak; on Friday and Sunday 11 month of the year and daily during Ramadan. It was started 4 years ago during Ramadan and it is hosted by Pakistan’s celebrity of showbiz industry Fahad Mustafa. Fahad Mostafa is youngest celebrity of Pakistan and he is hosting this show from the very first day till now. He has also done work in many drama serials and movies, his recent famous movie was Actor in Law. Jeeto Pakistan show is on aired at ARY channel in evening from 19:30 to 22:30. It is totally a commercial show which is sponsored by different companies like Q. Mobilejk , Sogo, Qarshi and many other companies. This show includes many segments and each segment offers different prizes like bikes, cars, gold, ummrah tickets, commercial plots and many other appliances are distributed among people. People are selected for this show by Lucky Draw and one can be selected by doing shopping of ...

A village Fair Essay

Mela 320 is an important event of our village. People call it third Eid of our village because all people gathered in the village like on Eid. It’s a big source of enjoyment not only for our village but also for the other nearby villages. People come from very far away areas to watch the mela 320. I have never missed mela 320 since my childhood. In mela 320 there is no cast religion, gender and age discrimination people from all age groups get amused themselves. Mela 320 held on the death anniversary of our village Soofi Sai Sondi. Now, successor of sai sondi, Sai Khalid which is perstigeous personality of our village and Chairman as well do sponser this mela to add more sources of enjoyment and also during mela days meal is served among all people. Any one from any caste or religion can  eat from this open meal. Mela 320 include events like football matches, kavadi matches, camle fight, horse dance, circus, well of death, swings, qawwali, eating stalls, toys stalls fir childre...

finding value of a character as integer in c++

#include<iostream> using namespace std; int main() { int x = 0x63; float y = 32.245; char z = 'c'; cout<< "x is " << x << " y is " << y << " z is " <<  z << '\n'; z = x; x = y; y = z; cout<< "x is " << x << " y is " << y << " z is " <<  z << '\n'; x = 0x5632; //how many bytes are needed for 0x5632? z = x; cout<< "x is " << x << '\n'; cout<< "z as a character is " << hex << z << "....and as integer..." <<  (int) z; return 0; } output x is 99 y is 32.245 z is c x is 32 y is 99 z is c x is 22o66 z as a character is 2....and as integer...32

operator values program in c++

#include<iostream> using namespace std; int main() { int i=0; int j=1; int k=5; bool btype = true; bool btype2 = false; cout<<i<<'\t'<<j<<'\t'<<k<<'\t'<<btype<<'\t'<<btype2<<'\t'<<endl; btype = 100<7 && !(5>10) || !btype2 && (j==0); cout<<i<<'\t'<<j<<'\t'<<k<<'\t'<<btype<<'\t'<<btype2<<'\t'<<endl; btype = 11>5 && (j=9) || (i=4); cout<<i<<'\t'<<j<<'\t'<<k<<'\t'<<btype<<'\t'<<btype2<<'\t'<<endl; btype = 10<4 || (i=1) && (j=7); cout<<i<<'\t'<<j<<'\t'<<k<<'\t'<<btype<<'\t'<<btype2<<'\t'<<endl; b...

base 10 to octal conversion of multiple numbers in c++ using for loop

#include<iomanip> #include<iostream> using namespace std; int main() { int x; for(int i=0;i<5;i++) {  cout<<"Please enter input:";  cin>>x; cout<<"Your input in base 10 is "<<x<<" and in base 8 is "<<oct<<x<<endl; } return 0; } *************************** output:

convert multiple numbers from base 10 to base 16 in c++ using for loop

#include<iomanip> #include<iostream> using namespace std; int main() { int x; for(int i=0;i<5;i++) {  cout<<"Please enter input:";  cin>>x; cout<<"Your input in base 10 is "<<x<<" and in base 16 is "<<hex<<x<<endl; } return 0; } ************************************ output:

Checking number of digits in C++ using if else conditions

#include<iostream> using namespace std; int main() { int x=0; int i; int y; int z; int a; int d; int c; int b; cout<<"enter a four digit number:"; cin>>x; a=x%10; y=x/10; b=y%10; z=y/10; c=z%10; d=z/10; if(d>9) { cout<<"number is not 4 digit"; } else if(d==0) { cout<<"number is not 4 digit"; } else { cout<<d<<endl; cout<<c<<endl; cout<<b<<endl; cout<<a<<endl; } return 0; } ************************ output:

a program in c++ to check either a number is a Armstrong or Not using while loop and if condition

#include<iostream> using namespace std; int main() { int x=0; int sum=0; int y; int a; int b; cout<<"enter a number:"; cin>>x; b=x; while(x>0) { a=x%10; y=a*a*a; x=x/10; sum+=y; } if(sum==b) { cout<<"The Number is Armstrong"; } else { cout<<"The Number is Not Armstrong"; } return 0; } ***************************************** output:

Using for loop Print a plus sign in c++

#include<iostream> using namespace std; int main () { for(int i=0; i<4; i++) { cout<<"     "<<"*"<<endl; } for(int j=0; j<6; j++) {     cout<<"*"<<" "; } cout<<endl; for(int i=0; i<4; i++) {     cout<<"     "<<"*"<<endl; } } ****************************88 output:

Do while loop program in c++

#include<iostream> using namespace std; void clearscreen(); main() { int x = 1; int y = 10; do { cout<<x; cout<<'\n'; x++; } while( x < y ); } ************************* Output:

Taking cube of numbers using function in C++

#include <iostream> int Cube ( int ) ; // prototype using namespace std; int main () {    int      x;    int      y ;     x   = 14 ;     y   =   9 ;    cout <<"My Number ="  << y ;    cout <<"and its cube is:"  << Cube (y) << endl ;    cout <<"Your Number ="  << x ;    cout <<"and its cube is:"  << Cube (x) << endl ;    return 0; } int Cube ( int n) {     int a;     a = n*n*n;     return a; } ************************************* output:

Combination Program using functions in c++

#include<iostream> using namespace std; int main () { int x, y, z, m, n, r; int o; int fac(int n); cout<<"number of man:"; cin>>n; x= fac(n); cout<<"number of thing:";     cin>>r; y= fac(r); z= n-r;     o = fac(z);     m = o*y;     n = x/m;     cout<<"total possible combination among them:"<<n;     return 0; } int fac(int n) {     int a=1;     for(int i=1; i<=n; i++)     { a= a*i;     } return a; } ************************************************* output:

Weight conversion program using functions in c++

#include<iostream> using namespace std; int num(int n) { cout<<"num of chocolate:"; cin>>n; return n; } int ounce(int a) { cout<<"weight in ounce:"; cin>>a; return a; } int pound(int b) { cout<<"weight in pound:"; cin>>b; return b; } int main () { int n, a, b; char choice; cout<<"enter choice 'o' for ounce and 'p' for pounds:"; cin>>choice; int x, y, z; x = num(n); y = ounce(a); z = pound(b); if (choice == 'o') {cout<<"total weight in ounce:"<<x*y;} if (choice == 'p') {cout<<"total weight in pounds:"<<x*z;} return 0; } ************************** Output:

Sum of numbers using function in c++

#include<iostream> using namespace std; void ud(int Number1,int Number2) { int k; k =Number1+Number2;     cout<<k; }  main() {     int x,y;     cout<<"enter no 1:";     cin>>x;     cout<<"enter no 2:";     cin>>y;     cout<<"sum of numbers is: ";     ud(x, y); } **************************************** output:

Swapping number program in c++

#include<iostream> using namespace std; main() { int x,y;     cout<<"enter no 1:";     cin>>x;     cout<<"enter no 2:";     cin>>y; cout<<x<<y; cout<<endl; swap(x,y); cout<<"Number after swaping: "; cout << x << y; } ************************************************* Output:

comparison of two values in c++

 #include <iostream> using namespace std; int max(int num1, int num2) {     int result;    if (num1 > num2)       {result = num1;}    else       {result = num2;}       result= result-7;    return result; } int min (int num1,int num2 ) {     int result;     if(num1<num2)         {result = num1;}     else        {result =num2;}        result= result+5;     return result; } int sum(int num1,int num2) {  int c, d, sum;  c = max(num1, num2);    d=min (num1, num2);    sum=c+d;    return sum; } int main () {    int a;    cin>>a;    int b;    cin>>b;    int  p;    p = sum(a, b);  if(p>10)    cout << "First entered val...

How to Print a running Fan in C++ using functions

#include<iostream> using namespace std; void fun() { cout<<"            *    "<<endl; cout<<"            *    "<<endl; cout<<"          *****  "<<endl; cout<<"            *    "<<endl; cout<<"            *    "<<endl; system cls(); } void fun2() { cout<<"          *   *"<<endl; cout<<"           * * "<<endl; cout<<"            *  "<<endl; cout<<"           * * "<<endl; cout<<"          *   *"<<endl; system cls(); } main() { while(1) { fun(); for (int i = 0; i < 100000000; i++) { } fun2(); for ...

How to sum numbers in c

#include<stdio.h> int main() {     int x, y;     printf("enter value of x:");     scanf("%d",&x);     printf("enter value of y:");     scanf("%d",&y);     printf("sum of x and y is= %d", x+y);     getch();     return 0; } *********************************************

Simple program in c for beginner

#include<stdio.h> int main() {     printf("i am a boy");     return 0; }

Bubble sort program by using pointers and functions in c

#include<stdio.h> void swap(int *x, int *y) { int temp; temp= *x; *x=*y; *y=temp; } int main() { int size,m,n; printf("Enter size of array:"); scanf("%d",&size); int a[size]; for(m=0;m<size;m++) { printf("Enter values of %d array element:",m); scanf("%d",&a[m]); } for(m=0;m<size;m++) { for(n=m+1;n<size;n++) { if(a[m]>a[n]) { swap(&a[m],&a[n]); } } } for(m=0;m<size;m++) { printf("%d\t",a[m]); } getch(); return 0; }

How to sum two 2D arrays

#include<stdio.h> int main() { int m,n,o,r,c; printf("Enter the number of rows of arrys:"); scanf("%d",&r); printf("Enter the number of colums of arrys:"); scanf("%d",&c); int a[r][c]; int b[r][c]; printf("\nEnter values of first 2d arrays:\n"); for(m=0;m<r;m++) {    for(n=0;n<c;n++)   { printf("Enter values of array element for %d row and %d coulm:",m,n);   scanf("%d",&a[m][n]);   } } printf("\nEnter values for 2nd arry element\n"); for(m=0;m<r;m++) {    for(n=0;n<c;n++)     {   printf("Enter values of array element for %d row and %d coulm:",m,n);     scanf("%d",&b[m][n]);   } } printf("\n"); printf("First aaray elements are\n"); for(m=0;m<r;m++) {     for(n=0;n<c;n++)    {   printf("%3d",a[m][n]);    }   printf("\n"); } printf("Second aaray elements...