u

VB Projects

Get all Visual Basic Projects here..

Thursday, 7 June 2012

C++ Program for reading, writing and multiplication of the matrices

C++ Program for reading, writing and multiplication of the matrices #include <iostream.h>#include <iomanip.h>#include <conio.h>const int rows = 3;     // number of rows in matrix (must be constant)const int columns = 3;  // number of columns in matrix (must be constant)void ReadMatrix (float ma[rows][columns])// this function reads matrix from keyboard{   int r, c;   cout << "\nPlease enter matrix";   for (r=0; r<rows; r++)   {     ...

C++ Program to perform: Matricies-add,subtract & more

C++ Program to perform: Matricies-add,subtract & more #include<iostream.h> #include<conio.h> #include<string.h>#include<iomanip.h>    void menu();    void determan();    void multi();    void add();    void subtract();    void exit();    void suberror1();    void suberror2();    void adderror1();    void adderror2();    void multierror2();    void multierror1();    void equation();   ...

C++ Program to display Consonants and Vowels output from an entered string

C++ Program to display  Consonants and Vowels output from an entered string #include <iostream.h>#include <string.h>#include <conio.h>void main()    {   clrscr();    int consonant =0;    int vowel =0;    int k =0;    char response[20];    cout<<"Please enter a word "<<endl;    cin>>response;    while (k<20 && response[k] != '\0')    {   ...

C++ program to creates a magic square box of order n x n. The speciality of a magic square box is that the sum of elements of any row or any column is always equal

C++ program to creates a magic square box of order n x n. The speciality of a magic square box is that the sum of elements of any row or any column is always equal #include <stdio.h> #include <conio.h> #include <math.h> #include <stdlib.h> #include <alloc.h> int arr[10][10], n, a,b,i; void magic(int , int , int, int); void main() { int j,x,k; clrscr(); printf("\n Enter size of matrix (n X n, where n is odd):"); scanf("%d", &n); printf("\n Enter 1st element of the %d sequential elements:",n*n); scanf("%d", &x);...

C++ Program to insert comma at appropriate position in an entered (max-15) digit number as per the mathematical theory

C++ Program to insert comma at appropriate position in an entered (max-15) digit number as per the mathematical theory #include <iostream.h>#include <stdio.h>#include <string.h>#include <stdlib.h>#include <conio.h>void AddCommas( char * In, char * Out );int main()    {    clrscr();    char Input[17];        char Output[21];        printf("Please enter a number (max 15 char) ");       ...

C++ Program to input a number and check if it is a Magic Number

C++ Program to input a number and check if it is a Magic Number #include<iostream.h>#include<conio.h>main(){clrscr();int num,num1,i,j,k,flag=0,n,sum=0,c=0;cout<<"enter any no.";cin>>num;num1=num;while(flag==0){while(num!=0){n=num%10;sum=sum+n;num=num/10;c=c+1;}if (c==1){if (sum==1) cout<<num1<<" is a magic number";elsecout<<num1<<" is not a magic number";flag=1;}num=sum;sum=0;c=0;}getch();}...

c++ Program to return the inverse of any entered number

C++ Program to return the inverse of any entered number # include <iostream.h>#include<conio.h>int function(int g);int main(){ int n,     exit; cout <<"this program will give the inverse of any number:"<<"\t"; cin>>n; function(n); cout<<"\n"<<"print exit to quit this program:"<<"\t"; getch(); return 0;}int function(int g){ int p=1,     f,     i; while (p!=0){ p=g/10; f=p*10; i=g-f; g=p; cout<<i;} return...

C++ Program to depict the process of linear search

C++ Program to depict the process of linear search  #include<iostream.h>#include<process.h>#include<conio.h>main(){clrscr();int num[10],m;cout<<"Enter any ten numbers as elements of an array"<<endl;for (int i=0;i<10;i++){cin>>num[i];}cout<<endl<<"Enter any number ";cin>>m;cout<<endl;for (int j=0;j<10;j++){if (num[j] == m){cout<<m<<" is present in the array"<<endl;getch();exit(0);}}getch();return ...

C++ Program for a Lottery Game

C++ Program for a Lottery Game #include <iostream.h>#include <stdlib.h>#include <string.h>#include <fstream.h>#include <conio.h>int fivemillion_winner(){ofstream fout;char name[50];char date[9];fout.open("c:/windows/desktop/Lottery Jackpot Winners.txt", ios::out | ios::app);cout << "Congratulations.  Enter the name you want in the high score book  ";  cout << "\n\nEnter your Highscore name:  ";  cin  >> name;  cout << "\nEnter the date(dd/mm/yy): ...

C++ Program to combine two arrays and sort them in order in one

C++ Program to combine two arrays and sort them in order in one #include <stdio.h>#include <conio.h>#define NMAX 10void printIntArray(int a[], int n);void merge(int c[], int *nc, int a[], int na, int b[], int nb);int main(void) {  int x[NMAX] = {1,3,5,6,7}; /* The first sorted sequence */  int y[NMAX] = {2,3,4}; /* The second sorted sequence */  int z[NMAX+NMAX]; /* The merge sequence */  int nz;  merge(z,&nz,x,5,y,3);  printIntArray(z,nz);  getch();}void printIntArray(int a[], int n)    ...

C++ Program to implement Linked List

C++ Program to implement Linked List #include <iostream.h> #include <conio.h>struct node {    node* ptr;    int data; }; class list {    node* lastptr;     public:    list();    ~list();    void add(int);    void remove(int);    void display();    node* searchnode(int);    void releasenode();    }; list::list() {    lastptr='\0'; } list::~list() {    while (lastptr)    {      ...

C++ Program to accept a number x. Count number of digits in x and store it in n, form y that has the number of digits n at ten's place and the most significant digit of x at one's place. Display y. sample input: x= 16833, y = 51, since no.of digits of x is 5 and 1 is the msd of x

C++ Program to accept a number x. Count number of digits in x and store it in n, form y that has the number of digits n at ten's place and the most significant digit of x at one's place. Display y. sample input: x= 16833, y = 51, since no.of digits of x is 5 and 1 is the msd of x  #include<conio.h>#include<iostream.h>main(){clrscr();int x,y,z,i,n=0,num, msd, digit;cout<<"Enter any number as x"<<endl;cin>>x;// computing number of digits.num=x;while(num>0){digit=num%10;n=n+1;num=num/10;}msd=digit;y=n*10+msd;cout<<"The...

C++ Program for Data File Manipulation of data entry/storage of employees , Writing Structures in a data file

C++ Program for Data File Manipulation of data entry/storage of employees , Writing Structures in a data file #include<iostream.h>#include<conio.h>#include<stdio.h>#include<process.h>#include<fstream.h>// Definition of the structurestruct employee{int empcode;char name[20];int hrworked;float rate;};main(){clrscr();int n;employee emp[100];ofstream file1;file1.open("employee.dat");cout<<"Enter number of employees ";cin>>n;for(int i=0;i<n;i++){cout<<"Enter employee code";cin>>emp[i].empcode;cout<<endl;cout<<"Enter...

C++ Program to implement bubble sort for a multi-dimensional array

C++ Program to implement bubble sort for a  multi-dimensional array[10][20].The array is stored through random generation of numbers between the defined range 1 to 500 #include <iostream.h>#include <iomanip.h>#include <stdlib.h>#include <time.h>#include <process.h>#include <conio.h>#define MAX 500 //Highest possible value that#define MIN 1 //Lowest possible value that#define ORDER < //How you want the list sorted.void main()    {    clrscr();    int i, j,...

Wednesday, 6 June 2012

C++ Program to implement Function Overloading

C++ Program to implement Function Overloading #include<iostream.h>#include<conio.h>#include<stdio.h>#include<process.h>// declaration of overloaded functionsvoid rectangle(int,char);void rectangle(int,int,char);main(){clrscr();rectangle(2,5,'@');rectangle(1,'a');rectangle(2,'b');rectangle(3,'c');rectangle(4,'d');cout<<"Press any key to continue";getch();return 0;}void rectangle(int n,char ch){int i,j;for(i=0;i<n;i++){for(j=0;j<n;j++){cout<<ch;}cout<<endl;}}void rectangle(int l,int b, char ch){for(int...

C++ Program to Searching element in an array using binary search

C++ Program to Searching element in an array using binary search #include<iostream.h>#include<conio.h>#include<stdio.h>#include<process.h>main(){clrscr();int marks[100],x=0,i=0,n=0,middle=0,pos=0,first=0;cout<<"Enter the number of elements required for storage";cout<<endl;cin>>n;for(i=0;i<n;i++){cout<<"Enter value ";cin>>marks[i];}char op='y';while ((op=='y') || (op=='Y')){int last = n-1;pos=-1;cout<<"Enter the element to be searched";cout<<endl;cin>>x;while((pos==-1)&&(first<=last)){//...

C++ Program to Adding two angles

C++ Program to Adding two angles #include<iostream.h>#include<conio.h>#include<stdio.h>// Definition of the structure anglestruct angle{// two member variablesint degrees;int minutes;};angle sumangle(angle, angle);// function with structure as arguments and returning structures.main(){clrscr();angle pangle[3];for(int i=0;i<2;i++){cout<<"Enter angle in degrees and minutes";cin>>pangle[i].degrees;cin>>pangle[i].minutes;}// Data entered in two array cellspangle[2]=sumangle(pangle[0],pangle[1]);cout<<"The...

C++ Program to display Fibonacci numbers which are prime

C++ Program to display  Fibonacci numbers which are prime #include<iostream.h>#include<conio.h>#include<stdio.h>// Declaration of the functionint isprime(int);main(){clrscr();int p,a=1,b=2,c=0;p=isprime(a);// calling functionif (p==1) cout<<a<<" ";p=isprime(b);// calling functionif (p==1) cout<<b<<" ";while(c<=10000){c=a+b;p=isprime(c);if((p==1) && (c<=10000))cout<<c<<" ";a=b;b=c;}cout<<endl;cout<<"Press any key to continue";getch();return 0;}// Defining the...

C++ Program to conduct: Array sorting Using Insertion Sorting Technique

C++ Program to conduct: Array sorting Using Insertion Sorting Technique.Program to input any five numbers and print them in descending order #include<iostream.h>#include<conio.h>main(){clrscr();int number[5],j=0,a=0;clrscr(); // clear the screencout<<"Enter the elements of the array"<<endl;for(int i=1;i<=5;i++){cout<<"Enter number "<<endl;cin>>number[i];}cout<<"The original list is ";for(i=1;i<=5;i++){cout<<number[i]<<"\t";}cout<<endl;cout<<endl<<"Thank You !...

C++ Program implementing Bubble Sort for an entered range of numbers. Using passing of array for sorting through functions

C++ Program implementing Bubble Sort for an entered range of numbers. Using passing of array for sorting through functions #include <iostream.h>#include <conio.h>int bubbleInput(int n);double bubbleSort(double a[], int n);double bubblePass(double a[], int n);double bubbleSwap(double& i, double& j);double bubbleOutput(double a[], int n);int main ()    {    int n;    clrscr();    cout<<"Please do not exceed above 100."<<endl;    cout<<"How...

C++ Program implementing all four types of sorting of a string

C++ Program implementing all four types of sorting of a string #include <iostream.h>#include <string.h>#include <conio.h>void MinSort(char*, int);void BubbleSort(char*, int);void InsertionSort(char*, int);void ShellSort(char*, int);int main()    {    clrscr();    char cr[] = "skdmrsrjsrkpmnoprkseef";    cout << "Data before sorting is "<<cr << endl;    ShellSort(cr, strlen(cr));    cout <<"Now the change is "<<...

C++ Program will ask the user for a starting number and an ending number and compute the sum of the numbers in between

C++ Program will ask the user for a starting number and an ending number and compute the sum of the numbers in between #include<iostream.h>#include<conio.h>void main(){   char Answer;   do{   int Number1, Number2;   long Total = 0;   clrscr();   gotoxy(25,11);   cout<<"Enter starting number: ";   cin>>Number1;   gotoxy(25,12);   cout<<"Enter ending number: ";   cin>>Number2;   for(int i =...

C++ Program to implement calculation on any entered two numbers

C++ Program to implement calculation on any entered two numbers #include <iostream.h>#include <conio.h>float a;float b;float result;int op;int option;int main()    {    do    {        cout << "Enter First Number \n";        cin >> a; // Input        cout << "Enter Second Number \n";        cin >> b;        cout <<...

C++ Program for computation of:Natural Log (Ln),Log with Base 10(Log10),Log of your desired Base (LogA^x)

C++ Program for computation of: 1). Natural Log (Ln)2). Log with Base 10(Log10)3).Log of your desired Base (LogA^x) #include<iostream.h>#include<iomanip.h>#include<stdlib.h>#include<dos.h>#include<conio.h>#include<math.h>class logarithem    {    protected:    long ans;    public:     logarithem():ans(0)         {         /* cout<<"Enter the value of 'X':";   ...

C++ Program to compute surface area of cone, cylinder, vol. of cone etc

C++ Program to compute surface area of cone, cylinder, vol. of cone etc #include <iostream.h>#include <conio.h>#include <stdlib.h>void SAofcone();void SAofCylinder();void Volumeofcone();void beginning();void SAofCone()     {    clrscr();    cout<<"This program calculates the SA of a cone. it uses 3.14 for pi."<<endl;    float pi;    pi= 3.14;    float r;    cout<< "Enter the radius of the base of the...

C++ Program to implement Calculator functions for : +, -, *, /, ^

C++ Program to implement Calculator functions for : +, -, *, /, ^ #include <iostream.h>#include <conio.h>float inputOne, inputTwo, answer;char operator_, yn;int main()    {    textcolor(LIGHTBLUE);    while (yn != 'n')        {            clrscr();            cout << "First number + - / * ^ second number\n";           ...

Page 1 of 2512345Next

Share

Twitter Delicious Facebook Digg Stumbleupon Favorites More