This is default featured slide 1 title

Go to Blogger edit html and find these sentences.Now replace these sentences with your own descriptions.

This is default featured slide 2 title

Go to Blogger edit html and find these sentences.Now replace these sentences with your own descriptions.

This is default featured slide 3 title

Go to Blogger edit html and find these sentences.Now replace these sentences with your own descriptions.

This is default featured slide 4 title

Go to Blogger edit html and find these sentences.Now replace these sentences with your own descriptions.

Graduate students of IIUI

Happiest Moment Celebrating thier life best Achievement

Sunday, 26 April 2015

Sorting in two classes student using Switch

sorting using switch

// newplusplus.cpp : Defines the entry point for the console application.
//share with your friends if u found any errors please comments thanks :) :)
#include "stdafx.h"
#include<iostream>
#include<fstream>
#include<string>
using namespace std;
int flag=0;
void sortedoutput(int [], int&);
void input1(int d1[],int &a)
{
for(int i=0; i<a; i++)
{
cout<<"ENTER THE MARKS OF STUDENT"<<i+1<<":";
cin>>d1[i];
}// for end

}// input 1 end
void output(int d2[],int &b)
{
cout<<"__________output_____________"<<endl;
for(int j=0; j<b; j++)
{
cout<<"THE INPUT MARKS OF STUDENT "<<j+1<<":";
cout<<d2[j]<<endl;
}
}

void sorting(int ds[],int &num)
{
cout<<"_________sorting function_________"<<endl;
int hold;
for(int z=0; z<num; z++)
{
for(int m=0; m<num-1; m++)
{
if(ds[m]>ds[m+1])
{
hold=ds[m];
ds[m]=ds[m+1];
ds[m+1]=hold;
} // if end
}// nested for end
} // for end
sortedoutput(ds,num);
 
}
void sortedoutput(int so[], int&n)
{
cout<<"_____sorted output____"<<endl;
for(int i=0; i<n; i++)
{
cout<<so[i]<<endl;
}
}


int main()
{
system("cls");

int data1[200]; // class A array
int data2[200]; //class B array
int a1,a2;

cout<<"  welcome to the sorting array values in two classes"<<endl;
do{


int ch;
cout<<"\t\t********MENU***********"<<endl;
cout<<"\t\t1) input class A student"<<endl;
cout<<"\t\t2) input class B student"<<endl;
cout<<"\t\tt3)show the student in class A"<<endl;
cout<<"\t\tt4)show the student in class B"<<endl;
cout<<"\t\t5)sort the student in class A"<<endl;
cout<<"\t\t6)sort the student in class B"<<endl;
cout<<"enter the choice"<<endl;
cin>>ch;
switch(ch)
{

case 1:

cout<<"HOW MANY STUDENT IN YOUR CLASS A"<<endl;
cin>>a1;
input1(data1,a1);
flag=1;

break;
case 2:

cout<<"how many student in class b"<<endl;
cin>>a2;
input1(data2,a2);

break;
case 3:

if(flag==1)
output(data1,a1);  

else
cout<<"ENTER the input first in class A"<<endl;

break;
case 4:
if(flag==1)
output(data2,a2);

else 
cout<<"Enter the input first class B"<<endl;
break;
case 5:
 sorting(data1,a1);
break;
case 6:

sorting(data2,a2);
 
default:
cout<<"input wrong"<<endl;

}// switch end

}while(1); // do while main end


system("pause");
return 0;
}


Bubble sort values Programme c++ using nested for loop

bubble sorting
int main()
{
int arr[50],n;
cout<<"how many number"<<endl;
cin>>n;
for(int i=0; i<n; i++)
{
cout<<"enter the number"<<i+1<<":";
cin>>arr[i];
}
cout<<"THe orignal numbers are"<<endl;
for(int j=0; j<n; j++)
{
cout<<arr[j]<<endl;

}

int hold;
cout<<"Now the sorted vales are"<<endl;
for(int i=0; i<n; i++)
{
for(int j=0; j<n-1; j++)
{
if(arr[j]>arr[j+1])
{
hold=arr[j];
arr[j]=arr[j+1];
arr[j+1]=hold;
}// if end
}//nested for end
}//for end


cout<<"The sorted vales are"<<endl;
for(int i=0; i<n; i++)
{
cout<<arr[i]<<endl;

}

system("pause");
return 0;
}
___________________________________________
OUTPUT

bubble sorting

Sunday, 23 November 2014

Source code of to find the palindrome with output screen.






#include "stdafx.h"
#include <iostream>
using namespace std;


int main()
{

  int num,temp,rem,sum=0;
  cout<<"Enter the number ";
  cin>>num;
  temp=num;
  while(num>0)
  {
rem=num%10;
num=num/10;
sum=(sum*10)+rem;
  }
  if(temp==sum)
 cout<<"The number is palindrome"<<sum;
  else
 cout<<"The number is not palindrome";
 
cout<<endl;
  system("pause");
return 0;
}

----------------------------------------------------
The output of this programme is:
palindrome programme

palindrome programme

Saturday, 22 November 2014

Display the following output using C++ language.

newplusplus

Here is C++ Coding

----------------------------------------------------------------

#include "stdafx.h"
#include <iostream>
using namespace std;

int main()
{  
int sum,i,j,lim;
cout<<"ENTER THE LIMIT";
cin>>lim;
for(i=1; i<=lim; i++) //for loop execution
{
cout<<"1";
sum=1;

for(j=2; j<=i; j++) // again for loop execution
{
cout<<"+"<<j;
sum=sum+j;

}
cout<<"="<<sum<<endl;
}
cout<<endl;

system("pause");
return 0;
}

=================================
output of this programe is :

output of the new c plusplus programe


Sunday, 16 November 2014

How to Calculate table in c puls plus programming complete code.





// saved name : Defines the entry point for the console application.
//

#include "stdafx.h"
#include<iostream>
using namespace std;


int main()
{

int table,lenght,c;
cout<<"Enter the table";
cin>>table;
cout<<"Enter the table lenght";
cin>>lenght;
for(c=1; c<=lenght; c++)
{
cout<<table<<"*"<<c<<"="<<table*c<<endl;
}
system("pause");
return 0;
}

-------------------------------------------------------

table using c++



Thursday, 13 November 2014

Using for loop to calculate and print product of add integers from 1 to 15.newplusplus panels

newplusplus odd integer







#include "stdafx.h"
#include <iostream>
using namespace std;

int main()
{
    int i,prod=1;

    for ( i = 1; i <=15; i+=2)
    {
       
            prod = i * prod;
    }
    cout << " product: " << prod <<endl;
system("pause");
    return 0;
}
-------------------------------------------------
output:



Calculate the Factorial of positive number in the range of 0 to 10.














#include "stdafx.h"
#include <iostream>
using namespace std;


int main()
{
int num,i,fact=1;
cout<<"Enter the number "<<endl;
cin>>num; 
if ((num==1)||(num<=10)) 
{
for(i=num;i>1;i--) 
{
fact*=i; //factorial formula 
}
cout<< "factorial of " <<num<<"="<<fact<<endl; 
}
else
cout<<"your enter number= " << num << "is invalid"<<endl;
system("pause");

return 0;
}
---------------------------------------------------

output: