0% found this document useful (0 votes)
22 views2 pages

Bahria University, Islamabad Campus: Department of Computer Sciences Class/Section: BSIT (1A&B)

This document contains instructions for Assignment #3 for a Computer Science class at Bahria University. It instructs students to [1] submit assignments in a format that can be opened, [2] allows using outside help but not copying directly, and [3] is due by April 12, 2020. It also provides two questions - to write a program to generate the Fibonacci sequence, and to sort an array of 20 integers in ascending and descending order using selection sort. Students are instructed to include comments explaining the code and required submission details.

Uploaded by

Aman Abbaxi
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
22 views2 pages

Bahria University, Islamabad Campus: Department of Computer Sciences Class/Section: BSIT (1A&B)

This document contains instructions for Assignment #3 for a Computer Science class at Bahria University. It instructs students to [1] submit assignments in a format that can be opened, [2] allows using outside help but not copying directly, and [3] is due by April 12, 2020. It also provides two questions - to write a program to generate the Fibonacci sequence, and to sort an array of 20 integers in ascending and descending order using selection sort. Students are instructed to include comments explaining the code and required submission details.

Uploaded by

Aman Abbaxi
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 2

Bahria University, Islamabad Campus

Department of Computer Sciences


Class/Section: BSIT (1A&B)
(Spring 2020 Semester)
Assignment # 3

Instructions marks [20]

Please read the following instructions carefully before submitting assignment

 You will not get any credit if the submitted assignment does not open because of
Corrupted file.
 You are free to take ‘help’ (but not copy paste) from any sources.
 Last date for assignment submission is Sunday, 12th of April, 2020.

Q1. What is meant by Fibonacci series/sequence? Write a program to generate Fibonacci


sequence.
#include<iostream>
#include<conio.h>
using namespace std;
int main()
{
int n1 = 0;
int n2 = 1;
int n3;
int k;
cout << "enter the number:" << endl;
cin >> k;
for (int i = 2; i <= k; i++) //loop starts from 2 because 0 and1 are alredy printed
{
n3 = n1 + n2;
cout << n3; //print n3
n1 = n2; //assigning the value of n2 to n1
n2 = n3; //assigning the value of n3 to n2
}
_getch();
return 0;

}
Q2. What is meant by selection sort using an array? Write a program to sort out an array of 20
integers. Such that you need to user input the array values and sort them in both
ascending and descending order using the selection sort mechanism.

REPORT SUBMISSION:

Submit ONLY the softcopy of the code written. The code must include comments
explaining all the components of the code in your own words. Your assignment
must have title page displaying your name class section and enrollment number.

Deadline for assignment submission is Sunday 12th of April, 2020.

**********************GOOD LUCK***************************

You might also like