Thursday, 24 January 2013

Lectures

You can get Lectures of 1dt semester by contact...

Tic Tac

// Program create on visual studio consol application. // Project: create Tic Tac game. // university: Govt. College university. // Department of computer science. // submitted by: Muhammad Ateek. // Roll number: 03-bscs-2011 // sysmester:  1st #include <iostream> // directory for input and output #include <cstdlib>  // directory to generate random numbers. #include <time.h>   // directory to generate seconds as a seeds of random number #include <windows.h> // directory for clr screeen. and sounds. #include <string>    // directory to get string type names of players. #include <conio.h> void computer(); int checkWinner(); void drawBoard(); using namespace std; int option, test, row, col,turn, with, option2 =0; string...

Searcher

// finder.cpp : Defines the entry point for the console application. // #include "stdafx.h" #include <iostream> #include <string> using namespace std; int counter = 0; int main() {     string names[5]= {"ali", "ateeq" , "shani", "jani", "azeem"};     string geter;     string user;     cout << "enter name" << endl;     cin >> user;         for(int j=0; j<=4; j++)     { geter=names[1];             counter = user.length();     for(int i=0; i<=user.length(); i++)     {                    ...

TicTac Toe Game

// Program create on visual studio consol application.// Project: create Tic Tac game.// university: Govt. College university.// Department of computer science.// submitted by: Muhammad Ateek.// Roll number: 03-bscs-2011// sysmester:  1st#include"stdafx.h"#include <iostream> // directory for input and output#include <cstdlib>  // directory to generate random numbers.#include <time.h>   // directory to generate seconds as a seeds of random number#include <windows.h> // directory for clr screeen. and sounds.#include <string>    // directory to get string type names of players.#include <conio.h>void computer();int checkWinner();void drawBoard();using namespace std;int option, test, row, col,turn, with, option2 =0;string player1,player2;char...

Sorting

#include <iostream>using namespace std;int main(){    int temp;    int mango[5];    for(int k=0; k<5;k++)    {    cin >> mango[k];    }    for(int j=0;j<5-i;j++)      {           if(mango[j]<mango[j+1])           {           temp = mango[j];           mango[j]=mango[j+1];           mango[j+1]=temp;           }     }    for (int k=0;k<5;k++)    {   ...

recursive factorial

#include <iostream> using namespace std; int factorial(int); int main() {     int number=5;  int fact;  fact = factorial(number);  cout << fact;     cin.get();     return 0; } int factorial(int number) {     if(number<=1)     {         return 1;     }     else     return number+factorial(number-1)...

recursive exponents

#include <iostream>using namespace std;int power (int, int);int main (){    int base, exp, result;    //obtain integer from user    cout<<"Enter the base value: ";    cin >>base;    cout<<"Enter the exponent value: ";    cin>>exp;    result = power(base, exp);    cout<<"The result is: "<< result << endl;    return 0;}// recursive definitionint power (int base, int exp){    // base case    if (exp==1)        return base * 1;    // recursive step    else if (exp >-1)        exp--;   ...

Power

// Find the power of any number// programmer: M.Ateek// class:      BSCS// symester:   1st// Roll #      03#include <iostream>using namespace std;int main(){int number,power,count,i;cout << "Enter Number: "; cin >> number;cout << "Enter the power: "; cin >> power;count = 1;for (i=1; i <=power; i++)count = count*number;cout << count << endl;cin.get();return ...

passing array from function as parameter

#include <iostream>using namespace std;int modified_array1(int [], int);int main(){    int array1[6];cout << "enter number to sort out\n";    for(int i=0; i<6; i++)    {        cin >> array1[i];    }    modified_array1(array1, 5);   cout << "Sorted numbers are ";    for(int j=0; j<5; j++)    {        cout << array1[j]<< " ";    }cin.get();return 0;}int modified_array1(int array_of_function[], int size){int temp;   for(int i=0; i<5; i++)    {    for(int j=0;j<5-i;j++)      {   ...

Palindrom

// palidrom.cpp : Defines the entry point for the console application. // #include <iostream> #include <conio.h> #include <string.h> using namespace std; int main() {  char strn[80]; int i,j,flag=0,len; cout<<"Enter the string:"; cin.getline(strn,80); len=strlen(strn); cout << endl << len; for(i=0,j=len-1;i<=(len/2);++i,--j) {     cout << i <<"=i" << endl << " " << j << "= j" << endl; if(strn[i]==strn[j]) flag=1; else if (strn[i]!=strn[j]) {     flag=0; break; } } if(flag) cout<<"Palindrome"; else cout<<"Not a palindrome"; getch()...

Menu for add subtract multiplication

#include <iostream>#include <iomanip>using namespace std;int main(){   int num1,num2;    char option;        cout << "enter your 1st number = ";           cin >> num1;        cout << "enter your 2nd number = ";           cin >> num2;cout << " What you want to do? \n";cout << "a: ADD \n" << "b: SUB\n" << "c: MUL\n" << "d: DIV\n";cout << "Type number of any option Example a,b,c,d\n";cin >> option;if ( option=='a'){    cout << "The addition is = ";    cout << num1+num2;}else if (option...

Grade Programming

//Program:    This program distribute your Grade with respect to marks.//Programmer: Muhammad Ateek. Roll#03//Date:       10/29/2011.#include <iostream>#include <limits>using namespace std;int main(){    cout << "Enter your obtained marks \n";// Declrations    int marks;    cin >> marks;    cout << "your abtained marks are = ";    cout << marks << endl;//Statments    if(marks<40)                           //If statments.    {        cout...

fibonacci series

#include <iostream>using namespace std;int fibonacci(int);int main(){    for(int number=0; number<=10; number++)    cout << fibonacci(number)<< " ";    return 0;}int fibonacci(int number){    if(number<=1)    {       return number;    }    else    return fibonacci(number-1) + fibonacci(number-2...

fabonaci series till 10

//fib series till  10.#include <iostream>using namespace std;int main(){    int a,b,c;    a=0;    b=1;    int i;    cout << a<< "\t" << b <<"\t" << a+b<< "\t";            for(i=1; i<= 10;i++)    {c=a+b;        if(c<10)        {cout << c << "\t";        }        a=b;        b=c;    }    cin.get();    return ...

fib series 1st 10

//fib series till  10.#include <iostream>using namespace std;int main(){    int a,b,c;    a=0;    b=1;    int i;    cout << a<< "\t" << b <<"\t" << a+b<< "\t";            for(i=1; i<= 7;i++)    {c=a+b;        cout << c << "\t";        a=b;        b=c;}    cin.get();    return ...

do while calculator manu

#include <iostream>#include <string>using namespace std;int main(){char opt;    int num1,num2;    char option;    do    {        cout << "enter your 1st number = ";           cin >> num1;        cout << "enter your 2nd number = ";           cin >> num2;cout << " What you want to do? \n";cout << "a: ADD \n" << "b: SUB\n" << "c: MUL\n" << "d: DIV\n";cout << "Type number of any option Example a,b,c,d\n";cin >> option;if ( option=='a'){    cout << "The addition is = ";   ...

Directory

#include "stdafx.h"#include <iostream>#include <windows.h>#include<string>COORD coord={0,0}; // function to set the cursor point         void gotoxy(int x,int y)       {             coord.X=x;             coord.Y=y;             SetConsoleCursorPosition(GetStdHandle(STD_OUTPUT_HANDLE),coord);       }using namespace std;int main(){  int check=0;    int x=0;    int y=0;    string enter;    string dir[6][5]={{"Country","Capital","Religion","Language","Land...

diamond

#include <iostream>#include <iomanip>using namespace std;int main(){int n = 7;int m = 1;int x = 6;for (int i = 0; i < 3; i++){    cout << setw(x);  x--;    for (int j = 0; j < m; j++)     cout << "*";        cout << endl;        m=m+2;        }        for (int i = 0; i < 4; i++){    cout << setw(x);  x++;    for (int j = 0; j < n; j++)     cout << "*";        cout << endl;        n=n-2;       ...

check of prime

#include <iostream>using namespace std;int main(){    int num;    bool prime;    cin >> num;    for (int i=2;i <=num-1;i++)    {      num%i;      if(num%i==0)      {          cout << "not prime";      break;      }      else if(num%i==1)      {          cout << "prime";          break;      }     }cin.get();    return ...

celcius function

#include <iostream>using namespace std;int main(){    cout << "C to F\n";    for (int celcius=0; celcius<=100; celcius++)    {        cout << celcius << "=  "<<  (celcius * 1.8) + 32 << endl;    }    char option;    float degrees;    cout << "Press 1 or 2 to convert From :" << endl;    cout << "[1] Celsius to Fahrenheit" << endl;    cout << "[2] Fahrenheit to Celsius" << endl;    cin >> option;    if (option == '1')    {        cout << "Please enter...

Array Sum

#include <iostream>using namespace std;int main(){    int sum=0;    int j;    cout << "How many numbers you want to add";cin >> j;    int x[j];    for(int i=0; i<=j;i++)    {cin >> x[i];sum=sum+x[i];    }cout << "The sum is = "<< sum;  cin.get();   return ...

array highest number

#include <iostream>using namespace std;int main(){   int y;cout << "how many values";   cin >> y;   int x[y];   for(int i=0; i<y;i++)   {       cin >> x[i];       if(x[0]<x[i])       {           x[0]=x[i];       }   }cout << x[0];    return ...

1 create table gotoxy

// Program create on visual studio consol application.// Assignment: create table by using "For Loop" and gotoxy funtion. // university: Govt. College university.// Department of computer science.// submitted by: Muhammad Ateek.// Roll number: 03-bscs-2011// sysmester:  1st// submitted to: Atifa Athar.#include "stdafx.h"#include <iostream>#include<windows.h>COORD coord={0,0}; // function to set the cursor point         void gotoxy(int x,int y)       {             coord.X=x;              coord.Y=y;             SetConsoleCursorPosition(GetStdHandle(STD_OUTPUT_HANDLE),coord);      ...

program 3-2(77) Demonstrate of compound assignment

// this program demonstrate the use of compound assignments.#include <iostream>#include <limits>using namespace std;int main(){    cout << "this program demonstrate the use of compound assignments.\n enter your two numbers\n";   int x;   int y;   cin >> x;   cin >> y;  cout << "x = " << x;  cout << "  : y = " << y << "\t |" << "x *= y \t | " << " = "<< (x*=y);    cin.ignore(numeric_limits<streamsize>::max(), '\n');    cin.get();    return ...

program 2-13(69) prob 12 print the asterisks shpwn below

#include <iostream>#include <limits>#include <iomanip>using namespace std;int main(){    for(int i=0; i<10; i++)    {     cout << "*";    }    cout << setw(15) << "* \n";    cout << setw(15) << "** \n";    cout << setw(15) << "*** \n";    cout << setw(15) << "***** \n";    cin.ignore(numeric_limits<streamsize>::max(), '\n');    cin.get();    return ...

program 2-13(69) 15

#include <iostream>#include <limits>using namespace std;int main(){    int a;    a = 1;    int b;    b= 10;    int c;    c= 100;    int d;    d= 1000;    cout << a;    cout << " ";    cout <<  b ;    cout << c ;    cout << d ;    cin.ignore(numeric_limits<streamsize>::max(), '\n');    cin.get();    return ...

program 2-13 69 print the patren

#include <iostream>#include <limits>#include <iomanip>using namespace std;int main(){    cout << setw(15) << "***** \n";    cout << setw(15) << "***** \n";    cout << setw(15) << "***** \n";    cout << setw(15) << "***** \n";    cin.ignore(numeric_limits<streamsize>::max(), '\n');    cin.get();    return ...

program 2-11(58) Print the value of selected characters

// this program give the value of the characters#include <iostream>#include <limits>using namespace std;int main(){    cout << "this program give the ascii value of characters like \n";    char a = 'a';    char b = 'b';    char z = 'z';    char nl = '\n';    char xxx;    cout << "a = " << (int)a << "\n";    cout << "b = " << (int)b << "\n";    cout << "z = " << (int)z << "\n";    cout << "nl = " << (int)nl << "\n";    cout << "if you want to check value of your desired number than write your number \n";    cin >>...

program 2-10(57) calculate the circle area and circumference

#include <iostream>#include <limits>using namespace std;int main(){    float red;    cout << "to calculate the circumference and area of the circle enter redius";    cin >> red;    cout << "circumference of the circle is = ";    cout << red*2*3.1416 << "\n";    cout << "area of the circle is = ";    cout << 3.1416*red*red;    cin.ignore(numeric_limits<streamsize>::max(), '\n');    cin.get();    return ...

program 2-8(54) Demonstrate fixed-point manipulator

// this program demonstrate the fixed-point manipulator.#include <iostream>#include <limits>#include <iomanip>using namespace std;int main(){    // variables.    float x = 1;    float y = 1.2345;    float z = 1234.89;    // process   cout << x << "\t | with no manipulators" << "\n" << y << "\n" << z << "\n" << "\n";   cout << fixed;   cout << x << "\t | with manipulator fixed" << "\n" << y << "\n" << z << "\n" << "\n";   cout << setprecision(2);   cout << x << "\t | with manipulator setprecision(2)" << "\n" << y <<...

program 2-7(52) Demonstrate numeric manipulator

// this program demonstrate the numeric use of manipulates..#include <iostream>#include <iomanip>#include <limits>using namespace std;int main(){    int x;    cout << "enter your number \n";    cin >> x;cout << "value in decimal \t |" << dec << x << "\n";cout << "value in octale \t |" << oct << x << "\n";cout << "value in hexadecimal \t |" << hex << x << "\n";    cin.ignore(numeric_limits<streamsize>::max(),'\n');    cin.get();    return ...

program 2-6(51) Demonstrate fill by character

// Demonstrate fill character program.#include <iostream>#include <limits>#include <iomanip>using namespace std;int main(){    // variables    int num1 = 12345;    int num2 = 54321;    // process    cout << setw(10)  << setfill('*') << num1 << "\t | setw 10 and it is fill with * \n";    cout << setw(10) << num2 << "\t | setw 10 and it fill with just spaces \n";   cin.ignore(numeric_limits<streamsize>::max(),'\n');   cin.get();    return ...

program 2-5(51) Demonstrate set width manipulatore

// Demonstrate the use of set width manipulator.#include <iostream>#include <iomanip>using namespace std;int main(){    cout << "results \n";    //variables    int num1 = 321;    int num2 = 231;// setw examples    cout << num1 << num2  << "\t | no setw \n";    cout << setw(1) << num1 << setw(1)<< num2 << "\t | 1 setw \n";    cout << setw(5) << num1 << setw(5) << num2 << "\t | 5 setw \n";    cout << setw(10) << "hallo" << "\t | string setw 10 \n";    cout << setw(3) << "hallo" << "\t | string setw 3 \n";    cin.ignore(numeric_limits<streamsize>::max(),...

program 2-2(40) print the sum of three input numbers

// This program calculate and print the sum of three digits.#include <iostream>#include <limits>using namespace std;int main(){    // input variables.    int num1;    int num2;    int num3;    // inputs    cout << "enter your first digit = ";    cin >> num1;    cout << "enter your second digit = ";    cin >> num2;    cout << "enter your third digit = ";    cin >> num3;    // process    cout << "your sum is = ";    cout << num1+num2+num3;    // ending    cin.ignore(numeric_limits<streamsize>::max(),...

The greeting program

#include <iostream>#include <limits>int main(){using namespace std;cout << "when i was child i was so much clever";cin.ignore(numeric_limits<streamsize>::max(), '\n');cin.get();return ...

program 1-3(9) the multiplication program

// this program read two numbers from the keyboard and print thier product. #include <iostream> #include<cmath> #include <limits> using namespace std; int main() {    int num1;        // variable    int num2;    cout << "enter your 1st number ";    cin >> num1;   // input    cout << "enter your 2nd number ";    cin >> num2;   // input    cout << "The mulitiple of two numbers = " << num1*num2;// product of two numbers.    cin.ignore(numeric_limits<streamsize>::max(), '\n');    cin.get();     return 0...

Verbs and Interjection

Contect us for this presentation..we will send you softc...

Operating systems

v\:* {behavior:url(#default#VML);} o\:* {behavior:url(#default#VML);} w\:* {behavior:url(#default#VML);} .shape {behavior:url(#default#VML);} Normal 0 false false false false EN-US X-NONE X-NONE /* Style...

Twitter Delicious Facebook Digg Stumbleupon Favorites More

 
Design by Free WordPress Themes | Bloggerized by Lasantha - Premium Blogger Themes | Enterprise Project Management