


Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
Prepare for your exams
Study with the several resources on Docsity
Earn points to download
Earn points by helping other students or get them with a premium plan
Sir Prachur Sharma took this quiz in class of Programming for Engineers course at Bhagwant University Rajasthan. It includes: Bubble, Sort, Algorithm, Upward, Top, Array, Rising, Increasing, Order, Pair, Calues, Identical, Compared
Typology: Exercises
1 / 4
This page cannot be seen from the preview
Don't miss anything!



#include<iostream.h>
void main()
int a[10]; cout<<"Enter the elements\n"; for(int i=0;i<10;i++) { cin>>a[i]; }
for ( i=0;i<10;i++) { for (int j=i;j<10;j++) { if (a[i]>a[j]) { int temp=a[i]; a[i]=a[j]; a[j]=temp; }
} }
for (i=0;i<10;i++) { cout<<a[i]<<endl;
}
struct student { int roll; char *name; char *department; int year; int courses;
//this function will check either //students enterd are not more than 500// void Enter_data_of_student();
//to print data of student whos roll no is given// void print_data_student(int roll);
//To print names of all students who joined in particular year// void print_names(int); };
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
#include"structfile.h" #include<iostream.h> static int r=1; static int y=1990; int check=0; void student::print_names(int yr) { if(yr==year) cout<<name<<endl; } void student::Enter_data_of_student() { //cout<<"Enter name:"; //cout<<"Enter Roll:"; //cout<<"Enter year:"; //cout<<"Enter dep: "; //cout<<"Enter course";
name="my_name"; roll=r; r++; department="std_deprtment";
int rr=0; cout<<"Enter roll no to print student data :"; cin>>rr; if(rr>std_no && rr<=0) cout<<"Error!!:-"<<endl; else { for(int k=0;k<std_no;k++) students[k].print_data_student(rr); }
}