Add to Favorites    Make Home Page 4653 Online  
 Language Categories  
 Our Services  

Home » C++ Home » Data Structures Home » Sorting of a structure data.

A D V E R T I S E M E N T

Search Projects & Source Codes:

Title Sorting of a structure data.
Author Faseeh
Author Email master_02 [at] hotmail.com
Description You see in this program that you can sort the
data of structure type array. This sorting is to be done with out using
built in sorting function................
Category C++ » Data Structures
Hits 366343
Code Select and Copy the Code
#include<iostream.h> #include<conio.h> #include<stdio.h> #include<iomanip.h> struct rec {char name[50]; int r_no; int p_no; double gpa; int sem; char lo_full; char ba; }; void main() {rec d[10]; int a,b[10],s_no,hold1,hold2,hold3,hold5; char hold6[50],get; double hold4; cout<<"Enter the total no of students : "; cin>>s_no; for(a=0;a<s_no;a++) { cout<<" ***************************************************************** *************** "; cout<<" Enter the Name : "; cin>>d[a].name; cout<<" "; cout<<" ------------------------------------------------------------------ ---------------"; cout<<" | Entering data of "<<d[a].name<<" |"; cout<<" ---------------------------------------------------------------- -----------------"; cout<<" Enter the Registration No : "; cin>>d[a].r_no; cout<<" Enter the Phone No : "; cin>>d[a].p_no; cout<<" Enter the Semister No : "; cin>>d[a].sem; cout<<" Enter the Batch No : "; cin>>d[a].ba; cout<<" Enter the G.P.A : "; cin>>d[a].gpa; if(d[a].sem>1) {cout<<"May the student is with full load : "; cin>>d[a].lo_full; } } for(int p=0;p<s_no-1;p++) for(int j=0;j<s_no-1;j++) if(d[j].r_no>d[j+1].r_no) {hold1=d[j].r_no; d[j].r_no=d[j+1].r_no; d[j+1].r_no=hold1; hold2=d[j].p_no; d[j].p_no=d[j+1].p_no; d[j+1].p_no=hold2; hold3=d[j].ba; d[j].ba=d[j+1].ba; d[j+1].ba=hold3; hold4=d[j].gpa; d[j].gpa=d[j+1].gpa; d[j+1].gpa=hold4; hold5=d[j].lo_full; d[j].lo_full=d[j+1].lo_full; d[j+1].lo_full=hold5; for(a=0;a[d].name[50]!='

Related Source Codes

Script Name Author
Moving ball screen saver karlmarx
The Classic Game of Snake & Ladder Lakshmi Narayana .A
Railway seat reservation question which comes in sapient VyomWorld
To calculate percentile Ravi Mathur
Send to folder ANIMESH SAHU
Analog clock and calendar Nazia & Rida
HIGH/LOW GAME MOLLY ARORA
Data structure (stack Implimentation) Swapnil B Adsure
Memory Game AnirudhSanyal
Easy Calc Anirudh Sanyal
GK Quiz Anirudh Sanyal
Hangman Game Manish Jain
Snakeman Manish Jain
Full month Calendar Nigi
Cursor shapes nigi

A D V E R T I S E M E N T




Google Groups Subscribe to SourceCodesWorld - Techies Talk
Email:

Free eBook - Interview Questions: Get over 1,000 Interview Questions in an eBook for free when you join JobsAssist. Just click on the button below to join JobsAssist and you will immediately receive the Free eBook with thousands of Interview Questions in an ebook when you join.

New! Click here to Add your Code!


ASP Home | C Home | C++ Home | COBOL Home | Java Home | Pascal Home
Source Codes Home Page

 Advertisements  

Google Search

Google

Source Codes World.com is a part of Vyom Network.

Vyom Network : Web Hosting | Dedicated Server | Free SMS, GRE, GMAT, MBA | Online Exams | Freshers Jobs | Software Downloads | Interview Questions | Jobs, Discussions | Placement Papers | Free eBooks | Free eBooks | Free Business Info | Interview Questions | Free Tutorials | Arabic, French, German | IAS Preparation | Jokes, Songs, Fun | Free Classifieds | Free Recipes | Free Downloads | Bangalore Info | Tech Solutions | Project Outsourcing, Web Hosting | GATE Preparation | MBA Preparation | SAP Info | Software Testing | Google Logo Maker | Freshers Jobs

Sitemap | Privacy Policy | Terms and Conditions | Important Websites
Copyright ©2003-2024 SourceCodesWorld.com, All Rights Reserved.
Page URL: http://www.sourcecodesworld.com/source/show.asp?ScriptID=495


Download Yahoo Messenger | Placement Papers | Free SMS | C Interview Questions | C++ Interview Questions | Quick2Host Review