Friday 27 January 2012

Arrays in the form of different Parameters



#include<iostream>
using namespace std;
int show_array(int arr[],int size,int *ptreven,int *ptrodd)
{ 
 for(int j=0;j<size;j++)
 {
  if(arr[j]%2==0)
   *ptreven=*ptreven+arr[j];
  else
   *ptrodd=*ptrodd+arr[j];
 }
 return (*ptreven+*ptrodd);
}

int main()
{
 //variables
 int const SIZE=10;
 int arr[SIZE];
 int sumeven=0,sumodd=0,totalsum=0; 
 
 //Calling
 for(int i=0;i<SIZE;i++)
 {
  cout<<"Enter number At "<<i<<" index :";
  cin>>arr[i];
 }
 totalsum=show_array(arr,SIZE,&sumeven,&sumodd);
 cout<<"Sum of even elements in array :"<<sumeven<<endl;
 cout<<"Sum of odd elements in array :"<<sumodd<<endl;
 cout<<"Sum of All elements in array :"<<totalsum<<endl;
 return 0;
}

Saturday 21 January 2012

Here is the 15th lecture of C++ programming
(2D Array).
Please click this link below and Attend an important Lecture 

Lecture 15
Here is the 14th lecture of C++ programming
(Inheritance).
Please click this link below and Attend an important Lecture
Lecture 14
Here is the 13rd lecture of C++ programming
(Constructors).
Please click this link below and Attend an important Lecture
 

Lecture 13
Here is the 12nd lecture of C++ programming
(Classes And Object 2).
Please click this link below and Attend an important Lecture
 

Lecture 12
Here is the 11st lecture of C++ programming
(Classes And Object).
Please click this link below and Attend an important Lecture

Lecture 11
Here is the 10th lecture of C++ programming
(Recuression).
Please click this link below and Attend an important Lecture
 

Lecture 10
Here is the 9th lecture of C++ programming
(Function Overloading).
Please click this link below and Attend an important Lecture
 
Lecture 9
Here is the 8th lecture of C++ programming
(Function).
Please click this link below and Attend an important Lecture

Lecture 8
Here is the 7th lecture of C++ programming
(Pointer).
Please click this link below and Attend an important Lecture. 
Lecture 7
Here is the 6th lecture of C++ programming
(Structures).
Please click this link below and Attend an important Lecture.
Lecture 6
Here is the 5th lecture of C++ programming
(Arrays).
Please click this link below and Attend an important Lecture.
Lecture 5
Here is the 4th lecture of C++ programming
(Statements).
Please click this link below and Attend an important Lecture.
Lecture 4

Friday 20 January 2012

Here is the 3rd lecture of C++ programming
(Statements).
Please click this link below and Attend an important Lecture.

C++ Lecture 3
Here is the 2nd lecture of C++ programming

(Data Types and Variables).
Please click this link below and Attend an important Lecture.


C++ Lecture 2

Here is the 1st lecture of C++ programming
(Basic Syntax).
Please click this link below and Attend an important Lecture.



C++ Lecture 1