BZU PAGES: Find Presentations, Reports, Student's Assignments and Daily Discussion; Bahauddin Zakariya University Multan Right Header

HOME BZU Mail Box Online Games Radio and TV Cricket All Albums
Go Back   BZU PAGES: Find Presentations, Reports, Student's Assignments and Daily Discussion; Bahauddin Zakariya University Multan > Institute of Computing > Bachelor of Science in Information Technology > BsIT 2nd Semester > Object Oriented Programming


Reply
 
Thread Tools Search this Thread Rate Thread Display Modes
  #1  
Old 09-03-2011, 12:09 AM
bonfire's Avatar
M.Arsalan Qureshi

 
Join Date: Oct 2008
Location: Garden Town, Multan Cantt
Posts: 616
Program / Discipline: BSTS
Class Roll Number: 09-31
bonfire has a reputation beyond reputebonfire has a reputation beyond reputebonfire has a reputation beyond reputebonfire has a reputation beyond reputebonfire has a reputation beyond reputebonfire has a reputation beyond reputebonfire has a reputation beyond reputebonfire has a reputation beyond reputebonfire has a reputation beyond reputebonfire has a reputation beyond reputebonfire has a reputation beyond repute
Default Program to compute the fibonacci series

Program to compute the fibonacci series

#include <iostream.h>
#include <conio.h>

void main()
{
clrscr();
int a,b,x,y,num1,ct;
a=0;
b=1;
cout << "Enter the number of terms (less than 25) : " << endl;
cin>>num1;
cout << a << endl;
cout << b << endl;
for(ct=1;ct<=num1-2;ct++)
{
x=a+b;
cout << x << endl;
y=a;
a=b;
b=x;
}
getch();
}
This program takes in the number of terms num1 in the fibonacci series (less than 25) as a screen input from the user.
It then computes the fibonacci series and prints it out using the 'cout' command.

Sample Input
12
Sample Output
0
1
1
2
3
5
8
13
21
34
55
89

__________________

Reply With Quote
Reply

Tags
compute, fibonacci, program, series


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
C-Sharp Program Double Linked List (All Functions In One Program) thecool Visual Programming 0 17-06-2011 08:58 PM
Afghanistan-Pakistan A series from May 25 BSIT07-01 Sports/Games 0 09-05-2011 09:51 PM
500 Nokia N-Series Games AbdulQuyum Mobile Stuff 0 22-08-2009 08:22 PM
Series 60 V2 Themes Collection AbdulQuyum Mobile Stuff 2 21-08-2009 02:26 AM
[Assignment] Recursive Function for Fibonacci Numbers in C BSIT07-01 Data Structure 2 06-10-2008 11:13 PM

Best view in Firefox
Almuslimeen.info | BZU Multan | Dedicated server hosting
Note: All trademarks and copyrights held by respective owners. We will take action against any copyright violation if it is proved to us.

All times are GMT +5. The time now is 04:33 PM.
Powered by vBulletin® Version 3.8.2
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.