SlideShare a Scribd company logo
2.
#include<iostream.h>
int main ()
{
int a[50];
int i,j,temp,n;
cout<<" how many element you want to read n";
cout<<"(but keep in mind less than or equal to 50 )"<<endl;
cin>>n;
cout<<"enter elements one by one "<<endl;
for(i=0;i<=(n-1);i++)
cin>>a[i];
cout<<"the array in unsorted form:"<<endl;
for(i=0;i<=(n-1);i++)
{
cout<<a[i]<<endl;
}
for(i=0;i<=(n-2);i++)
for(j=i+1;j<=(n-1);j++)
if(a[i]>a[j])
{
temp=a[i];
a[i]=a[j];
a[j]=temp;
}
03.
#include<iostream.h>
#include<conio.h>
void main()
{
int m[3][2],i,j,x,y,s[3];
cout<<"enter the order of matrixn";
cin>>x>>y;
cout<<"enter the matrixn";
for(i=0;i<3;i++)
for(j=0;j<2;j++)
cin>>m[i][j];
for(i=0;i<3;i++)
s[i]=0;
for(i=0;i<3;i++)
for(j=0;j<2;j++)
s[i]=s[i]+m[i][j];
cout<<"the sum of each row isn";
for(i=0;i<3;i++)
cout<<s[i]<<endl;
getch();
}
4. #include <iostream.h>
void binary(int);
void main(void) {
int number;
cout << "Please enter a positive integer: "<<endl;
cin >> number;
if (number < 0)
cout << "That is not a positive integer.n";
else {
cout << number << " converted to binary is: ";
binary(number);
cout << endl;
}
}
void binary(int number) {
int remainder;
if(number <= 1) {
cout << number;
return;
}
7.
#include<iostream.h>
int main ()
{
int a[3][3]={{4,6,9},{6,1,0},{1,5,2}};
int i,j,trace;
trace=0;
for(i=0;i<=2;i++)
for(j=0;j<=2;j++)
{
if(i==j)
trace=trace+a[i][j];
}
cout<<"the trace is:"<<trace;
return 0;
}
8.
#include<iostream.h>
#include<conio.h>
#include<conio.h>
void main()
{
int o[2][2],p[2][2],i,j,a,b,l,m,x,y,s[2][2];
cout<<"enter the order of matrixn";
cin>>x>>y;
cout<<"enter the row of first matrixn";
cin>>a;
cout<<"enter the column of first matrixn";
cin>>b;
cout<<"enter the row of second matrixn";
cin>>l;
cout<<"enter the column of secod matrixn";
cin>>m;
cout<<"enter the first matrixn";
for(i=0;i<a;i++)
for(j=0;j<b;j++)
cin>>o[i][j];
cout<<"entr the second matrixn";
for(i=0;i<l;i++)
for(j=0;j<m;j++)
cin>>p[i][j];
10.
#include<iostream.h>
struct personal{
char name[20];
char dateofbirth[15];
char bloodgroup[10];
float height;
char contactadress[25];
char telephonenum[20];
char drivinglicensenum[18];
char qualification[30];
};
int main()
{
personal p1;
cout<<"enter person name:n";
cin>>p1.name;
cout<<"enter date of birth in ddd/mmm/yyy:n";
cin>>p1.dateofbirth;
cout<<"enter the blood group:n";
cin>>p1.bloodgroup;
cout<<"enter the height:n";
cin>>p1.height;
cout<<"enter contact address :n";
cin>>p1.contactadress;

More Related Content

What's hot

とある断片の超動的言語
とある断片の超動的言語とある断片の超動的言語
とある断片の超動的言語
Kiyotaka Oku
 
Асинхронность и многопоточность в Яндекс.Такси — Дмитрий Курилов
Асинхронность и многопоточность в Яндекс.Такси — Дмитрий КуриловАсинхронность и многопоточность в Яндекс.Такси — Дмитрий Курилов
Асинхронность и многопоточность в Яндекс.Такси — Дмитрий Курилов
Yandex
 
Javascript Without Javascript
Javascript Without JavascriptJavascript Without Javascript
Javascript Without Javascript
Patrick Kettner
 
大量地区化解决方案V5
大量地区化解决方案V5大量地区化解决方案V5
大量地区化解决方案V5
bqconf
 
Clojure functions midje
Clojure functions midjeClojure functions midje
Clojure functions midje
Jackson dos Santos Olveira
 
Sorting programs
Sorting programsSorting programs
Sorting programs
Varun Garg
 
Program membalik kata
Program membalik kataProgram membalik kata
Program membalik kata
haqiemisme
 
Ac cuda c_5
Ac cuda c_5Ac cuda c_5
Ac cuda c_5
Josh Wyatt
 
Part2 from math import * from simpson import * k=1 def f(x): return (exp(-(x...
Part2 from math import * from simpson import *  k=1 def f(x): return (exp(-(x...Part2 from math import * from simpson import *  k=1 def f(x): return (exp(-(x...
Part2 from math import * from simpson import * k=1 def f(x): return (exp(-(x...
hwbloom25
 
20151224-games
20151224-games20151224-games
20151224-games
Noritada Shimizu
 
2016 gunma.web games-and-asm.js
2016 gunma.web games-and-asm.js2016 gunma.web games-and-asm.js
2016 gunma.web games-and-asm.js
Noritada Shimizu
 
OPTIMAL BINARY SEARCH
OPTIMAL BINARY SEARCHOPTIMAL BINARY SEARCH
OPTIMAL BINARY SEARCH
Cool Guy
 
Java JIT Optimization Research
Java JIT Optimization Research Java JIT Optimization Research
Java JIT Optimization Research
Adam Feldscher
 
Logic Equations Resolver J Script
Logic Equations Resolver   J ScriptLogic Equations Resolver   J Script
Logic Equations Resolver J Script
Roman Agaev
 
Document
DocumentDocument
Document
AjitRaj12
 
The Ring programming language version 1.5.3 book - Part 40 of 184
The Ring programming language version 1.5.3 book - Part 40 of 184The Ring programming language version 1.5.3 book - Part 40 of 184
The Ring programming language version 1.5.3 book - Part 40 of 184
Mahmoud Samir Fayed
 
Useful javascript
Useful javascriptUseful javascript
Useful javascript
Lei Kang
 
Week 5
Week 5Week 5
Week 5
준성 조
 
ES2015 New Features
ES2015 New FeaturesES2015 New Features
ES2015 New Features
Giacomo Zinetti
 
Google App Engine Developer - Day3
Google App Engine Developer - Day3Google App Engine Developer - Day3
Google App Engine Developer - Day3
Simon Su
 

What's hot (20)

とある断片の超動的言語
とある断片の超動的言語とある断片の超動的言語
とある断片の超動的言語
 
Асинхронность и многопоточность в Яндекс.Такси — Дмитрий Курилов
Асинхронность и многопоточность в Яндекс.Такси — Дмитрий КуриловАсинхронность и многопоточность в Яндекс.Такси — Дмитрий Курилов
Асинхронность и многопоточность в Яндекс.Такси — Дмитрий Курилов
 
Javascript Without Javascript
Javascript Without JavascriptJavascript Without Javascript
Javascript Without Javascript
 
大量地区化解决方案V5
大量地区化解决方案V5大量地区化解决方案V5
大量地区化解决方案V5
 
Clojure functions midje
Clojure functions midjeClojure functions midje
Clojure functions midje
 
Sorting programs
Sorting programsSorting programs
Sorting programs
 
Program membalik kata
Program membalik kataProgram membalik kata
Program membalik kata
 
Ac cuda c_5
Ac cuda c_5Ac cuda c_5
Ac cuda c_5
 
Part2 from math import * from simpson import * k=1 def f(x): return (exp(-(x...
Part2 from math import * from simpson import *  k=1 def f(x): return (exp(-(x...Part2 from math import * from simpson import *  k=1 def f(x): return (exp(-(x...
Part2 from math import * from simpson import * k=1 def f(x): return (exp(-(x...
 
20151224-games
20151224-games20151224-games
20151224-games
 
2016 gunma.web games-and-asm.js
2016 gunma.web games-and-asm.js2016 gunma.web games-and-asm.js
2016 gunma.web games-and-asm.js
 
OPTIMAL BINARY SEARCH
OPTIMAL BINARY SEARCHOPTIMAL BINARY SEARCH
OPTIMAL BINARY SEARCH
 
Java JIT Optimization Research
Java JIT Optimization Research Java JIT Optimization Research
Java JIT Optimization Research
 
Logic Equations Resolver J Script
Logic Equations Resolver   J ScriptLogic Equations Resolver   J Script
Logic Equations Resolver J Script
 
Document
DocumentDocument
Document
 
The Ring programming language version 1.5.3 book - Part 40 of 184
The Ring programming language version 1.5.3 book - Part 40 of 184The Ring programming language version 1.5.3 book - Part 40 of 184
The Ring programming language version 1.5.3 book - Part 40 of 184
 
Useful javascript
Useful javascriptUseful javascript
Useful javascript
 
Week 5
Week 5Week 5
Week 5
 
ES2015 New Features
ES2015 New FeaturesES2015 New Features
ES2015 New Features
 
Google App Engine Developer - Day3
Google App Engine Developer - Day3Google App Engine Developer - Day3
Google App Engine Developer - Day3
 

Viewers also liked

Desarrollo de Espacios Virtuales para Entrenamiento de las Actividades de la ...
Desarrollo de Espacios Virtuales para Entrenamiento de las Actividades de la ...Desarrollo de Espacios Virtuales para Entrenamiento de las Actividades de la ...
Desarrollo de Espacios Virtuales para Entrenamiento de las Actividades de la ...
Juan Manuel Gonzalez Calleros
 
Suzy
SuzySuzy
Durkheim dos leyes_evolucion_penal
Durkheim dos leyes_evolucion_penalDurkheim dos leyes_evolucion_penal
Durkheim dos leyes_evolucion_penal
Sara Ester Valladares Nuñez
 
Proiect Ioc Regie Poker
Proiect Ioc   Regie PokerProiect Ioc   Regie Poker
Proiect Ioc Regie Pokergueste1aed80
 
La rebelión global y los patriarcas
La rebelión global y los patriarcasLa rebelión global y los patriarcas
La rebelión global y los patriarcas
https://gramadal.wordpress.com/
 
по добро представителство на жените в железопътния транспорт
по добро представителство на жените в железопътния транспортпо добро представителство на жените в железопътния транспорт
по добро представителство на жените в железопътния транспортTheFires
 
PPT Transformación Ágil
PPT Transformación ÁgilPPT Transformación Ágil
PPT Transformación Ágil
Edgar Pelayo
 
Boletin 217 de mano en mano
Boletin 217 de mano en manoBoletin 217 de mano en mano
Boletin 217 de mano en mano
Martin Triana
 
Mapa mental sobre Derecho Internacional Público
Mapa mental sobre Derecho Internacional PúblicoMapa mental sobre Derecho Internacional Público
Mapa mental sobre Derecho Internacional Público
Nereyda Josefina Pérez García
 
5. What Is The Evidence For Global Warming Nsr
5. What Is The Evidence For Global Warming   Nsr5. What Is The Evidence For Global Warming   Nsr
5. What Is The Evidence For Global Warming Nsr
tudorgeog
 
Cuadro bienes de dominio público y privado
Cuadro bienes de dominio público y privadoCuadro bienes de dominio público y privado
Cuadro bienes de dominio público y privado
ysmarycaruci
 
Open education resources (oer)
Open education resources (oer)Open education resources (oer)
Open education resources (oer)
Rosario Passos
 
Issues for people living in urban areas in rich countries the inner city
Issues for people living in urban areas in rich countries   the inner cityIssues for people living in urban areas in rich countries   the inner city
Issues for people living in urban areas in rich countries the inner city
tudorgeog
 
Las primeras-presidencias-del-uruguay
Las primeras-presidencias-del-uruguayLas primeras-presidencias-del-uruguay
Las primeras-presidencias-del-uruguay
Fernando de los Ángeles
 
Los Derechos y Deberes de los comuneros
Los Derechos y Deberes de los comunerosLos Derechos y Deberes de los comuneros
Los Derechos y Deberes de los comuneros
carola bolivar
 
La comunicación
La comunicaciónLa comunicación
La comunicación
tnruizg
 
ecologia
ecologiaecologia
Bases de participación
Bases de participaciónBases de participación
Michigan ASD State Plan 2013
Michigan ASD State Plan 2013Michigan ASD State Plan 2013
Michigan ASD State Plan 2013
Rebecca Brinkley
 

Viewers also liked (20)

Desarrollo de Espacios Virtuales para Entrenamiento de las Actividades de la ...
Desarrollo de Espacios Virtuales para Entrenamiento de las Actividades de la ...Desarrollo de Espacios Virtuales para Entrenamiento de las Actividades de la ...
Desarrollo de Espacios Virtuales para Entrenamiento de las Actividades de la ...
 
Suzy
SuzySuzy
Suzy
 
667_conference (1)
667_conference (1)667_conference (1)
667_conference (1)
 
Durkheim dos leyes_evolucion_penal
Durkheim dos leyes_evolucion_penalDurkheim dos leyes_evolucion_penal
Durkheim dos leyes_evolucion_penal
 
Proiect Ioc Regie Poker
Proiect Ioc   Regie PokerProiect Ioc   Regie Poker
Proiect Ioc Regie Poker
 
La rebelión global y los patriarcas
La rebelión global y los patriarcasLa rebelión global y los patriarcas
La rebelión global y los patriarcas
 
по добро представителство на жените в железопътния транспорт
по добро представителство на жените в железопътния транспортпо добро представителство на жените в железопътния транспорт
по добро представителство на жените в железопътния транспорт
 
PPT Transformación Ágil
PPT Transformación ÁgilPPT Transformación Ágil
PPT Transformación Ágil
 
Boletin 217 de mano en mano
Boletin 217 de mano en manoBoletin 217 de mano en mano
Boletin 217 de mano en mano
 
Mapa mental sobre Derecho Internacional Público
Mapa mental sobre Derecho Internacional PúblicoMapa mental sobre Derecho Internacional Público
Mapa mental sobre Derecho Internacional Público
 
5. What Is The Evidence For Global Warming Nsr
5. What Is The Evidence For Global Warming   Nsr5. What Is The Evidence For Global Warming   Nsr
5. What Is The Evidence For Global Warming Nsr
 
Cuadro bienes de dominio público y privado
Cuadro bienes de dominio público y privadoCuadro bienes de dominio público y privado
Cuadro bienes de dominio público y privado
 
Open education resources (oer)
Open education resources (oer)Open education resources (oer)
Open education resources (oer)
 
Issues for people living in urban areas in rich countries the inner city
Issues for people living in urban areas in rich countries   the inner cityIssues for people living in urban areas in rich countries   the inner city
Issues for people living in urban areas in rich countries the inner city
 
Las primeras-presidencias-del-uruguay
Las primeras-presidencias-del-uruguayLas primeras-presidencias-del-uruguay
Las primeras-presidencias-del-uruguay
 
Los Derechos y Deberes de los comuneros
Los Derechos y Deberes de los comunerosLos Derechos y Deberes de los comuneros
Los Derechos y Deberes de los comuneros
 
La comunicación
La comunicaciónLa comunicación
La comunicación
 
ecologia
ecologiaecologia
ecologia
 
Bases de participación
Bases de participaciónBases de participación
Bases de participación
 
Michigan ASD State Plan 2013
Michigan ASD State Plan 2013Michigan ASD State Plan 2013
Michigan ASD State Plan 2013
 

Similar to Abebe1

Cpp c++ 1
Cpp c++ 1Cpp c++ 1
Sortings
SortingsSortings
Sortings
maamir farooq
 
Computer Science Practical Science C++ with SQL commands
Computer Science Practical Science C++ with SQL commandsComputer Science Practical Science C++ with SQL commands
Computer Science Practical Science C++ with SQL commands
Vishvjeet Yadav
 
OOP 2012 - Hint: Dynamic allocation in c++
OOP 2012 - Hint: Dynamic allocation in c++OOP 2012 - Hint: Dynamic allocation in c++
OOP 2012 - Hint: Dynamic allocation in c++
Allan Sun
 
Ds program-print
Ds program-printDs program-print
Ds program-print
Chaitanya Kn
 
y Bookmarks People Window Helo Online Derivative edusubmi tionassig.docx
 y Bookmarks People Window Helo Online Derivative edusubmi tionassig.docx y Bookmarks People Window Helo Online Derivative edusubmi tionassig.docx
y Bookmarks People Window Helo Online Derivative edusubmi tionassig.docx
ajoy21
 
C++ Programming - 2nd Study
C++ Programming - 2nd StudyC++ Programming - 2nd Study
C++ Programming - 2nd Study
Chris Ohk
 
I have written the code but cannot complete the assignment please help.pdf
I have written the code but cannot complete the assignment please help.pdfI have written the code but cannot complete the assignment please help.pdf
I have written the code but cannot complete the assignment please help.pdf
shreeaadithyaacellso
 
C++ L07-Struct
C++ L07-StructC++ L07-Struct
C++ L07-Struct
Mohammad Shaker
 
C++ practical
C++ practicalC++ practical
C++ practical
Rahul juneja
 
Programa.eje
Programa.ejePrograma.eje
Programa.eje
guapi387
 
oodp elab.pdf
oodp elab.pdfoodp elab.pdf
oodp elab.pdf
SWATIKUMARIRA2111030
 
Lecture 5Arrays on c++ for Beginner.pptx
Lecture 5Arrays on c++ for Beginner.pptxLecture 5Arrays on c++ for Beginner.pptx
Lecture 5Arrays on c++ for Beginner.pptx
arjurakibulhasanrrr7
 
C++ file
C++ fileC++ file
C++ file
Mukund Trivedi
 
C++ file
C++ fileC++ file
C++ file
Mukund Trivedi
 
54602399 c-examples-51-to-108-programe-ee01083101
54602399 c-examples-51-to-108-programe-ee0108310154602399 c-examples-51-to-108-programe-ee01083101
54602399 c-examples-51-to-108-programe-ee01083101
premrings
 
C++ 4
C++ 4C++ 4
C++ 4
Syed Umair
 
Data structures / C++ Program examples
Data structures / C++ Program examplesData structures / C++ Program examples
Data structures / C++ Program examples
Kevin III
 
Go vs C++ - CppRussia 2019 Piter BoF
Go vs C++ - CppRussia 2019 Piter BoFGo vs C++ - CppRussia 2019 Piter BoF
Go vs C++ - CppRussia 2019 Piter BoF
Timur Safin
 
Stl algorithm-Basic types
Stl algorithm-Basic typesStl algorithm-Basic types
Stl algorithm-Basic types
mohamed sikander
 

Similar to Abebe1 (20)

Cpp c++ 1
Cpp c++ 1Cpp c++ 1
Cpp c++ 1
 
Sortings
SortingsSortings
Sortings
 
Computer Science Practical Science C++ with SQL commands
Computer Science Practical Science C++ with SQL commandsComputer Science Practical Science C++ with SQL commands
Computer Science Practical Science C++ with SQL commands
 
OOP 2012 - Hint: Dynamic allocation in c++
OOP 2012 - Hint: Dynamic allocation in c++OOP 2012 - Hint: Dynamic allocation in c++
OOP 2012 - Hint: Dynamic allocation in c++
 
Ds program-print
Ds program-printDs program-print
Ds program-print
 
y Bookmarks People Window Helo Online Derivative edusubmi tionassig.docx
 y Bookmarks People Window Helo Online Derivative edusubmi tionassig.docx y Bookmarks People Window Helo Online Derivative edusubmi tionassig.docx
y Bookmarks People Window Helo Online Derivative edusubmi tionassig.docx
 
C++ Programming - 2nd Study
C++ Programming - 2nd StudyC++ Programming - 2nd Study
C++ Programming - 2nd Study
 
I have written the code but cannot complete the assignment please help.pdf
I have written the code but cannot complete the assignment please help.pdfI have written the code but cannot complete the assignment please help.pdf
I have written the code but cannot complete the assignment please help.pdf
 
C++ L07-Struct
C++ L07-StructC++ L07-Struct
C++ L07-Struct
 
C++ practical
C++ practicalC++ practical
C++ practical
 
Programa.eje
Programa.ejePrograma.eje
Programa.eje
 
oodp elab.pdf
oodp elab.pdfoodp elab.pdf
oodp elab.pdf
 
Lecture 5Arrays on c++ for Beginner.pptx
Lecture 5Arrays on c++ for Beginner.pptxLecture 5Arrays on c++ for Beginner.pptx
Lecture 5Arrays on c++ for Beginner.pptx
 
C++ file
C++ fileC++ file
C++ file
 
C++ file
C++ fileC++ file
C++ file
 
54602399 c-examples-51-to-108-programe-ee01083101
54602399 c-examples-51-to-108-programe-ee0108310154602399 c-examples-51-to-108-programe-ee01083101
54602399 c-examples-51-to-108-programe-ee01083101
 
C++ 4
C++ 4C++ 4
C++ 4
 
Data structures / C++ Program examples
Data structures / C++ Program examplesData structures / C++ Program examples
Data structures / C++ Program examples
 
Go vs C++ - CppRussia 2019 Piter BoF
Go vs C++ - CppRussia 2019 Piter BoFGo vs C++ - CppRussia 2019 Piter BoF
Go vs C++ - CppRussia 2019 Piter BoF
 
Stl algorithm-Basic types
Stl algorithm-Basic typesStl algorithm-Basic types
Stl algorithm-Basic types
 

Abebe1

  • 1. 2. #include<iostream.h> int main () { int a[50]; int i,j,temp,n; cout<<" how many element you want to read n"; cout<<"(but keep in mind less than or equal to 50 )"<<endl; cin>>n; cout<<"enter elements one by one "<<endl; for(i=0;i<=(n-1);i++) cin>>a[i]; cout<<"the array in unsorted form:"<<endl; for(i=0;i<=(n-1);i++) { cout<<a[i]<<endl; } for(i=0;i<=(n-2);i++) for(j=i+1;j<=(n-1);j++) if(a[i]>a[j]) { temp=a[i]; a[i]=a[j]; a[j]=temp; }
  • 2. 03. #include<iostream.h> #include<conio.h> void main() { int m[3][2],i,j,x,y,s[3]; cout<<"enter the order of matrixn"; cin>>x>>y; cout<<"enter the matrixn"; for(i=0;i<3;i++) for(j=0;j<2;j++) cin>>m[i][j]; for(i=0;i<3;i++) s[i]=0; for(i=0;i<3;i++) for(j=0;j<2;j++) s[i]=s[i]+m[i][j]; cout<<"the sum of each row isn"; for(i=0;i<3;i++) cout<<s[i]<<endl; getch(); }
  • 3. 4. #include <iostream.h> void binary(int); void main(void) { int number; cout << "Please enter a positive integer: "<<endl; cin >> number; if (number < 0) cout << "That is not a positive integer.n"; else { cout << number << " converted to binary is: "; binary(number); cout << endl; } } void binary(int number) { int remainder; if(number <= 1) { cout << number; return; }
  • 4. 7. #include<iostream.h> int main () { int a[3][3]={{4,6,9},{6,1,0},{1,5,2}}; int i,j,trace; trace=0; for(i=0;i<=2;i++) for(j=0;j<=2;j++) { if(i==j) trace=trace+a[i][j]; } cout<<"the trace is:"<<trace; return 0; }
  • 5. 8. #include<iostream.h> #include<conio.h> #include<conio.h> void main() { int o[2][2],p[2][2],i,j,a,b,l,m,x,y,s[2][2]; cout<<"enter the order of matrixn"; cin>>x>>y; cout<<"enter the row of first matrixn"; cin>>a; cout<<"enter the column of first matrixn"; cin>>b; cout<<"enter the row of second matrixn"; cin>>l; cout<<"enter the column of secod matrixn"; cin>>m; cout<<"enter the first matrixn"; for(i=0;i<a;i++) for(j=0;j<b;j++) cin>>o[i][j]; cout<<"entr the second matrixn"; for(i=0;i<l;i++) for(j=0;j<m;j++) cin>>p[i][j];
  • 6. 10. #include<iostream.h> struct personal{ char name[20]; char dateofbirth[15]; char bloodgroup[10]; float height; char contactadress[25]; char telephonenum[20]; char drivinglicensenum[18]; char qualification[30]; }; int main() { personal p1; cout<<"enter person name:n"; cin>>p1.name; cout<<"enter date of birth in ddd/mmm/yyy:n"; cin>>p1.dateofbirth; cout<<"enter the blood group:n"; cin>>p1.bloodgroup; cout<<"enter the height:n"; cin>>p1.height; cout<<"enter contact address :n"; cin>>p1.contactadress;