SlideShare ist ein Scribd-Unternehmen logo
1 von 1
// include the library for print menssages at console
#include <stdio.h>
// Author: German Augusto Niebles Alvarez
// version 1.0
// Created on 2016/12/17
// C Program which prints the six first fibonacci numbers
// define fibonacci function
void oneFibonacciSecuence()
{
int maxNumero;
int unFibo1;
int unFibo2;
int unCounter;
// store value for counter, upper limit of the loop
maxNumero = 6;
// init counter in 2 for the firt two fibonnaci numbers
unCounter = 2;
printf("The first 6 fibonacci numbers aren");
// init first fibonacci number
unFibo1 = 0;
// init second fibonacci number
unFibo2 = 1;
printf("%unFibo1", unFibo1);
printf("n");
// make a loop for calculate next four fibonacci numbers
while (unCounter<=maxNumero){
printf("%unFibo2" , unFibo2);
printf("n");
// update next fibo number 2 in secuence
unFibo2 = unFibo1 + unFibo2;
// calculate net fibo number 1 in secuence
unFibo1 = unFibo2 - unFibo1;
unCounter = unCounter + 1;
} // end while
} // end function
// Main program
int main()
{
// call fibonacci function
oneFibonacciSecuence();
return 0;
} // end main

Weitere ähnliche Inhalte

Was ist angesagt? (20)

Intro to c programming
Intro to c programmingIntro to c programming
Intro to c programming
 
matplotlib-installatin-interactive-contour-example-guide
matplotlib-installatin-interactive-contour-example-guidematplotlib-installatin-interactive-contour-example-guide
matplotlib-installatin-interactive-contour-example-guide
 
Mangling Ruby with TracePoint
Mangling Ruby with TracePointMangling Ruby with TracePoint
Mangling Ruby with TracePoint
 
week-1x
week-1xweek-1x
week-1x
 
week-11x
week-11xweek-11x
week-11x
 
week-4x
week-4xweek-4x
week-4x
 
week-10x
week-10xweek-10x
week-10x
 
Metasploit cheat sheet
Metasploit cheat sheetMetasploit cheat sheet
Metasploit cheat sheet
 
Session07 recursion
Session07 recursionSession07 recursion
Session07 recursion
 
week-18x
week-18xweek-18x
week-18x
 
basic shell_programs
 basic shell_programs basic shell_programs
basic shell_programs
 
Applications of list
Applications of listApplications of list
Applications of list
 
Show Us: SS7 Update
Show Us: SS7 UpdateShow Us: SS7 Update
Show Us: SS7 Update
 
ESUG15: SS7 Update
ESUG15: SS7 UpdateESUG15: SS7 Update
ESUG15: SS7 Update
 
Adding two integers in c
Adding two integers in cAdding two integers in c
Adding two integers in c
 
Labsheet_3
Labsheet_3Labsheet_3
Labsheet_3
 
Taller Ensambladores
Taller EnsambladoresTaller Ensambladores
Taller Ensambladores
 
Python programs - PPT file (Polytechnics)
Python programs - PPT file (Polytechnics)Python programs - PPT file (Polytechnics)
Python programs - PPT file (Polytechnics)
 
Understanding UNIX CASE and TPUT
Understanding UNIX CASE and TPUTUnderstanding UNIX CASE and TPUT
Understanding UNIX CASE and TPUT
 
Codigo fuente
Codigo fuenteCodigo fuente
Codigo fuente
 

Andere mochten auch

Better Open Source Enterprise C++ Web Services
Better Open Source Enterprise C++ Web ServicesBetter Open Source Enterprise C++ Web Services
Better Open Source Enterprise C++ Web ServicesWSO2
 
Milot Shala - C++ (OSCAL2014)
Milot Shala - C++ (OSCAL2014)Milot Shala - C++ (OSCAL2014)
Milot Shala - C++ (OSCAL2014)Open Labs Albania
 
Static analysis of C++ source code
Static analysis of C++ source codeStatic analysis of C++ source code
Static analysis of C++ source codeAndrey Karpov
 
5 2factoring trinomial i
5 2factoring trinomial i5 2factoring trinomial i
5 2factoring trinomial imath123a
 
Fibonacci The Man of Numbers
Fibonacci The Man of NumbersFibonacci The Man of Numbers
Fibonacci The Man of NumbersCha Mlln
 
Algorithms practice and problem solving - dynamic programming
Algorithms practice and problem solving - dynamic programmingAlgorithms practice and problem solving - dynamic programming
Algorithms practice and problem solving - dynamic programmingXochitl Watts
 
Source code analyzer
Source code analyzer Source code analyzer
Source code analyzer OSLL
 
Tula, talumpati, maikling kwento, pabula, sanaysay
Tula, talumpati, maikling kwento, pabula, sanaysayTula, talumpati, maikling kwento, pabula, sanaysay
Tula, talumpati, maikling kwento, pabula, sanaysayMariel Flores
 

Andere mochten auch (8)

Better Open Source Enterprise C++ Web Services
Better Open Source Enterprise C++ Web ServicesBetter Open Source Enterprise C++ Web Services
Better Open Source Enterprise C++ Web Services
 
Milot Shala - C++ (OSCAL2014)
Milot Shala - C++ (OSCAL2014)Milot Shala - C++ (OSCAL2014)
Milot Shala - C++ (OSCAL2014)
 
Static analysis of C++ source code
Static analysis of C++ source codeStatic analysis of C++ source code
Static analysis of C++ source code
 
5 2factoring trinomial i
5 2factoring trinomial i5 2factoring trinomial i
5 2factoring trinomial i
 
Fibonacci The Man of Numbers
Fibonacci The Man of NumbersFibonacci The Man of Numbers
Fibonacci The Man of Numbers
 
Algorithms practice and problem solving - dynamic programming
Algorithms practice and problem solving - dynamic programmingAlgorithms practice and problem solving - dynamic programming
Algorithms practice and problem solving - dynamic programming
 
Source code analyzer
Source code analyzer Source code analyzer
Source code analyzer
 
Tula, talumpati, maikling kwento, pabula, sanaysay
Tula, talumpati, maikling kwento, pabula, sanaysayTula, talumpati, maikling kwento, pabula, sanaysay
Tula, talumpati, maikling kwento, pabula, sanaysay
 

Ähnlich wie Print First 6 Fibonacci Numbers in C

CorePy High-Productivity CellB.E. Programming
CorePy High-Productivity CellB.E. ProgrammingCorePy High-Productivity CellB.E. Programming
CorePy High-Productivity CellB.E. ProgrammingSlide_N
 
Write a MIPS assembler program that uses a function which calculates t.docx
Write a MIPS assembler program that uses a function which calculates t.docxWrite a MIPS assembler program that uses a function which calculates t.docx
Write a MIPS assembler program that uses a function which calculates t.docxlez31palka
 
2600 v09 n1 (spring 1992)
2600 v09 n1 (spring 1992)2600 v09 n1 (spring 1992)
2600 v09 n1 (spring 1992)Felipe Prado
 
You will be implementing the following functions. You may modify the.pdf
You will be implementing the following functions. You may modify the.pdfYou will be implementing the following functions. You may modify the.pdf
You will be implementing the following functions. You may modify the.pdfmalavshah9013
 
I have come code already but I cant quite get the output rig.pdf
I have come code already but I cant quite get the output rig.pdfI have come code already but I cant quite get the output rig.pdf
I have come code already but I cant quite get the output rig.pdfkashishkochhar5
 
Catastrophic Cancellation
Catastrophic CancellationCatastrophic Cancellation
Catastrophic CancellationC4Media
 
Writing simple buffer_overflow_exploits
Writing simple buffer_overflow_exploitsWriting simple buffer_overflow_exploits
Writing simple buffer_overflow_exploitsD4rk357 a
 

Ähnlich wie Print First 6 Fibonacci Numbers in C (9)

A N T I A V
A N T I  A VA N T I  A V
A N T I A V
 
CorePy High-Productivity CellB.E. Programming
CorePy High-Productivity CellB.E. ProgrammingCorePy High-Productivity CellB.E. Programming
CorePy High-Productivity CellB.E. Programming
 
03-fortran.ppt
03-fortran.ppt03-fortran.ppt
03-fortran.ppt
 
Write a MIPS assembler program that uses a function which calculates t.docx
Write a MIPS assembler program that uses a function which calculates t.docxWrite a MIPS assembler program that uses a function which calculates t.docx
Write a MIPS assembler program that uses a function which calculates t.docx
 
2600 v09 n1 (spring 1992)
2600 v09 n1 (spring 1992)2600 v09 n1 (spring 1992)
2600 v09 n1 (spring 1992)
 
You will be implementing the following functions. You may modify the.pdf
You will be implementing the following functions. You may modify the.pdfYou will be implementing the following functions. You may modify the.pdf
You will be implementing the following functions. You may modify the.pdf
 
I have come code already but I cant quite get the output rig.pdf
I have come code already but I cant quite get the output rig.pdfI have come code already but I cant quite get the output rig.pdf
I have come code already but I cant quite get the output rig.pdf
 
Catastrophic Cancellation
Catastrophic CancellationCatastrophic Cancellation
Catastrophic Cancellation
 
Writing simple buffer_overflow_exploits
Writing simple buffer_overflow_exploitsWriting simple buffer_overflow_exploits
Writing simple buffer_overflow_exploits
 

Kürzlich hochgeladen

IGNOU MSCCFT and PGDCFT Exam Question Pattern: MCFT003 Counselling and Family...
IGNOU MSCCFT and PGDCFT Exam Question Pattern: MCFT003 Counselling and Family...IGNOU MSCCFT and PGDCFT Exam Question Pattern: MCFT003 Counselling and Family...
IGNOU MSCCFT and PGDCFT Exam Question Pattern: MCFT003 Counselling and Family...PsychoTech Services
 
Introduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The BasicsIntroduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The BasicsTechSoup
 
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...christianmathematics
 
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...EduSkills OECD
 
Paris 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activityParis 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activityGeoBlogs
 
Activity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfActivity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfciinovamais
 
Advanced Views - Calendar View in Odoo 17
Advanced Views - Calendar View in Odoo 17Advanced Views - Calendar View in Odoo 17
Advanced Views - Calendar View in Odoo 17Celine George
 
Z Score,T Score, Percential Rank and Box Plot Graph
Z Score,T Score, Percential Rank and Box Plot GraphZ Score,T Score, Percential Rank and Box Plot Graph
Z Score,T Score, Percential Rank and Box Plot GraphThiyagu K
 
Nutritional Needs Presentation - HLTH 104
Nutritional Needs Presentation - HLTH 104Nutritional Needs Presentation - HLTH 104
Nutritional Needs Presentation - HLTH 104misteraugie
 
Key note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdfKey note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdfAdmir Softic
 
Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111Sapana Sha
 
The basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptxThe basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptxheathfieldcps1
 
General AI for Medical Educators April 2024
General AI for Medical Educators April 2024General AI for Medical Educators April 2024
General AI for Medical Educators April 2024Janet Corral
 
Arihant handbook biology for class 11 .pdf
Arihant handbook biology for class 11 .pdfArihant handbook biology for class 11 .pdf
Arihant handbook biology for class 11 .pdfchloefrazer622
 
Unit-IV- Pharma. Marketing Channels.pptx
Unit-IV- Pharma. Marketing Channels.pptxUnit-IV- Pharma. Marketing Channels.pptx
Unit-IV- Pharma. Marketing Channels.pptxVishalSingh1417
 
BAG TECHNIQUE Bag technique-a tool making use of public health bag through wh...
BAG TECHNIQUE Bag technique-a tool making use of public health bag through wh...BAG TECHNIQUE Bag technique-a tool making use of public health bag through wh...
BAG TECHNIQUE Bag technique-a tool making use of public health bag through wh...Sapna Thakur
 
Web & Social Media Analytics Previous Year Question Paper.pdf
Web & Social Media Analytics Previous Year Question Paper.pdfWeb & Social Media Analytics Previous Year Question Paper.pdf
Web & Social Media Analytics Previous Year Question Paper.pdfJayanti Pande
 
Ecosystem Interactions Class Discussion Presentation in Blue Green Lined Styl...
Ecosystem Interactions Class Discussion Presentation in Blue Green Lined Styl...Ecosystem Interactions Class Discussion Presentation in Blue Green Lined Styl...
Ecosystem Interactions Class Discussion Presentation in Blue Green Lined Styl...fonyou31
 
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...Krashi Coaching
 

Kürzlich hochgeladen (20)

IGNOU MSCCFT and PGDCFT Exam Question Pattern: MCFT003 Counselling and Family...
IGNOU MSCCFT and PGDCFT Exam Question Pattern: MCFT003 Counselling and Family...IGNOU MSCCFT and PGDCFT Exam Question Pattern: MCFT003 Counselling and Family...
IGNOU MSCCFT and PGDCFT Exam Question Pattern: MCFT003 Counselling and Family...
 
Introduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The BasicsIntroduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The Basics
 
Advance Mobile Application Development class 07
Advance Mobile Application Development class 07Advance Mobile Application Development class 07
Advance Mobile Application Development class 07
 
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...
 
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
 
Paris 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activityParis 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activity
 
Activity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfActivity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdf
 
Advanced Views - Calendar View in Odoo 17
Advanced Views - Calendar View in Odoo 17Advanced Views - Calendar View in Odoo 17
Advanced Views - Calendar View in Odoo 17
 
Z Score,T Score, Percential Rank and Box Plot Graph
Z Score,T Score, Percential Rank and Box Plot GraphZ Score,T Score, Percential Rank and Box Plot Graph
Z Score,T Score, Percential Rank and Box Plot Graph
 
Nutritional Needs Presentation - HLTH 104
Nutritional Needs Presentation - HLTH 104Nutritional Needs Presentation - HLTH 104
Nutritional Needs Presentation - HLTH 104
 
Key note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdfKey note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdf
 
Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111
 
The basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptxThe basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptx
 
General AI for Medical Educators April 2024
General AI for Medical Educators April 2024General AI for Medical Educators April 2024
General AI for Medical Educators April 2024
 
Arihant handbook biology for class 11 .pdf
Arihant handbook biology for class 11 .pdfArihant handbook biology for class 11 .pdf
Arihant handbook biology for class 11 .pdf
 
Unit-IV- Pharma. Marketing Channels.pptx
Unit-IV- Pharma. Marketing Channels.pptxUnit-IV- Pharma. Marketing Channels.pptx
Unit-IV- Pharma. Marketing Channels.pptx
 
BAG TECHNIQUE Bag technique-a tool making use of public health bag through wh...
BAG TECHNIQUE Bag technique-a tool making use of public health bag through wh...BAG TECHNIQUE Bag technique-a tool making use of public health bag through wh...
BAG TECHNIQUE Bag technique-a tool making use of public health bag through wh...
 
Web & Social Media Analytics Previous Year Question Paper.pdf
Web & Social Media Analytics Previous Year Question Paper.pdfWeb & Social Media Analytics Previous Year Question Paper.pdf
Web & Social Media Analytics Previous Year Question Paper.pdf
 
Ecosystem Interactions Class Discussion Presentation in Blue Green Lined Styl...
Ecosystem Interactions Class Discussion Presentation in Blue Green Lined Styl...Ecosystem Interactions Class Discussion Presentation in Blue Green Lined Styl...
Ecosystem Interactions Class Discussion Presentation in Blue Green Lined Styl...
 
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
 

Print First 6 Fibonacci Numbers in C

  • 1. // include the library for print menssages at console #include <stdio.h> // Author: German Augusto Niebles Alvarez // version 1.0 // Created on 2016/12/17 // C Program which prints the six first fibonacci numbers // define fibonacci function void oneFibonacciSecuence() { int maxNumero; int unFibo1; int unFibo2; int unCounter; // store value for counter, upper limit of the loop maxNumero = 6; // init counter in 2 for the firt two fibonnaci numbers unCounter = 2; printf("The first 6 fibonacci numbers aren"); // init first fibonacci number unFibo1 = 0; // init second fibonacci number unFibo2 = 1; printf("%unFibo1", unFibo1); printf("n"); // make a loop for calculate next four fibonacci numbers while (unCounter<=maxNumero){ printf("%unFibo2" , unFibo2); printf("n"); // update next fibo number 2 in secuence unFibo2 = unFibo1 + unFibo2; // calculate net fibo number 1 in secuence unFibo1 = unFibo2 - unFibo1; unCounter = unCounter + 1; } // end while } // end function // Main program int main() { // call fibonacci function oneFibonacciSecuence(); return 0; } // end main