SlideShare a Scribd company logo
// 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

More Related Content

What's hot

Intro to c programming
Intro to c programmingIntro to c programming
Intro to c programming
Prabhu Govind
 
matplotlib-installatin-interactive-contour-example-guide
matplotlib-installatin-interactive-contour-example-guidematplotlib-installatin-interactive-contour-example-guide
matplotlib-installatin-interactive-contour-example-guide
Arulalan T
 
Mangling Ruby with TracePoint
Mangling Ruby with TracePointMangling Ruby with TracePoint
Mangling Ruby with TracePoint
Mark
 
week-1x
week-1xweek-1x
week-11x
week-11xweek-11x
week-4x
week-4xweek-4x
week-10x
week-10xweek-10x
Metasploit cheat sheet
Metasploit cheat sheetMetasploit cheat sheet
Metasploit cheat sheet
hughpearse
 
Session07 recursion
Session07 recursionSession07 recursion
Session07 recursion
HarithaRanasinghe
 
week-18x
week-18xweek-18x
basic shell_programs
 basic shell_programs basic shell_programs
basic shell_programs
madhugvskr
 
Applications of list
Applications of listApplications of list
Applications of list
Elavarasi K
 
Show Us: SS7 Update
Show Us: SS7 UpdateShow Us: SS7 Update
Show Us: SS7 Update
ESUG
 
ESUG15: SS7 Update
ESUG15: SS7 UpdateESUG15: SS7 Update
ESUG15: SS7 Update
ZWEIDENKER GmbH
 
Adding two integers in c
Adding two integers in cAdding two integers in c
Adding two integers in c
Khuthbu Din
 
Labsheet_3
Labsheet_3Labsheet_3
Labsheet_3
rohassanie
 
Taller Ensambladores
Taller EnsambladoresTaller Ensambladores
Taller Ensambladores
Christian Morales
 
Python programs - PPT file (Polytechnics)
Python programs - PPT file (Polytechnics)Python programs - PPT file (Polytechnics)
Python programs - PPT file (Polytechnics)
SHAMJITH KM
 
Understanding UNIX CASE and TPUT
Understanding UNIX CASE and TPUTUnderstanding UNIX CASE and TPUT
Understanding UNIX CASE and TPUT
Dan Morrill
 
Codigo fuente
Codigo fuenteCodigo fuente
Codigo fuente
BlackD10
 

What's hot (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
 

Viewers also liked

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
WSO2
 
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 code
Andrey Karpov
 
5 2factoring trinomial i
5 2factoring trinomial i5 2factoring trinomial i
5 2factoring trinomial i
math123a
 
Fibonacci The Man of Numbers
Fibonacci The Man of NumbersFibonacci The Man of Numbers
Fibonacci The Man of Numbers
Cha 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 programming
Xochitl 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, sanaysay
Mariel Flores
 

Viewers also liked (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
 

Similar to Fibonacci surce code

A N T I A V
A N T I  A VA N T I  A V
A N T I A V
Ngo Hung Long
 
CorePy High-Productivity CellB.E. Programming
CorePy High-Productivity CellB.E. ProgrammingCorePy High-Productivity CellB.E. Programming
CorePy High-Productivity CellB.E. Programming
Slide_N
 
03-fortran.ppt
03-fortran.ppt03-fortran.ppt
03-fortran.ppt
thomashughes837337
 
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
lez31palka
 
Linux Systems Programming: Inter Process Communication (IPC) using Pipes
Linux Systems Programming: Inter Process Communication (IPC) using PipesLinux Systems Programming: Inter Process Communication (IPC) using Pipes
Linux Systems Programming: Inter Process Communication (IPC) using Pipes
RashidFaridChishti
 
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.pdf
malavshah9013
 
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
kashishkochhar5
 
Catastrophic Cancellation
Catastrophic CancellationCatastrophic Cancellation
Catastrophic Cancellation
C4Media
 
Writing simple buffer_overflow_exploits
Writing simple buffer_overflow_exploitsWriting simple buffer_overflow_exploits
Writing simple buffer_overflow_exploits
D4rk357 a
 

Similar to Fibonacci surce code (10)

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
 
Linux Systems Programming: Inter Process Communication (IPC) using Pipes
Linux Systems Programming: Inter Process Communication (IPC) using PipesLinux Systems Programming: Inter Process Communication (IPC) using Pipes
Linux Systems Programming: Inter Process Communication (IPC) using Pipes
 
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
 

Recently uploaded

A Independência da América Espanhola LAPBOOK.pdf
A Independência da América Espanhola LAPBOOK.pdfA Independência da América Espanhola LAPBOOK.pdf
A Independência da América Espanhola LAPBOOK.pdf
Jean Carlos Nunes Paixão
 
The History of Stoke Newington Street Names
The History of Stoke Newington Street NamesThe History of Stoke Newington Street Names
The History of Stoke Newington Street Names
History of Stoke Newington
 
Azure Interview Questions and Answers PDF By ScholarHat
Azure Interview Questions and Answers PDF By ScholarHatAzure Interview Questions and Answers PDF By ScholarHat
Azure Interview Questions and Answers PDF By ScholarHat
Scholarhat
 
writing about opinions about Australia the movie
writing about opinions about Australia the moviewriting about opinions about Australia the movie
writing about opinions about Australia the movie
Nicholas Montgomery
 
RPMS TEMPLATE FOR SCHOOL YEAR 2023-2024 FOR TEACHER 1 TO TEACHER 3
RPMS TEMPLATE FOR SCHOOL YEAR 2023-2024 FOR TEACHER 1 TO TEACHER 3RPMS TEMPLATE FOR SCHOOL YEAR 2023-2024 FOR TEACHER 1 TO TEACHER 3
RPMS TEMPLATE FOR SCHOOL YEAR 2023-2024 FOR TEACHER 1 TO TEACHER 3
IreneSebastianRueco1
 
Main Java[All of the Base Concepts}.docx
Main Java[All of the Base Concepts}.docxMain Java[All of the Base Concepts}.docx
Main Java[All of the Base Concepts}.docx
adhitya5119
 
ANATOMY AND BIOMECHANICS OF HIP JOINT.pdf
ANATOMY AND BIOMECHANICS OF HIP JOINT.pdfANATOMY AND BIOMECHANICS OF HIP JOINT.pdf
ANATOMY AND BIOMECHANICS OF HIP JOINT.pdf
Priyankaranawat4
 
clinical examination of hip joint (1).pdf
clinical examination of hip joint (1).pdfclinical examination of hip joint (1).pdf
clinical examination of hip joint (1).pdf
Priyankaranawat4
 
Hindi varnamala | hindi alphabet PPT.pdf
Hindi varnamala | hindi alphabet PPT.pdfHindi varnamala | hindi alphabet PPT.pdf
Hindi varnamala | hindi alphabet PPT.pdf
Dr. Mulla Adam Ali
 
BBR 2024 Summer Sessions Interview Training
BBR  2024 Summer Sessions Interview TrainingBBR  2024 Summer Sessions Interview Training
BBR 2024 Summer Sessions Interview Training
Katrina Pritchard
 
Exploiting Artificial Intelligence for Empowering Researchers and Faculty, In...
Exploiting Artificial Intelligence for Empowering Researchers and Faculty, In...Exploiting Artificial Intelligence for Empowering Researchers and Faculty, In...
Exploiting Artificial Intelligence for Empowering Researchers and Faculty, In...
Dr. Vinod Kumar Kanvaria
 
LAND USE LAND COVER AND NDVI OF MIRZAPUR DISTRICT, UP
LAND USE LAND COVER AND NDVI OF MIRZAPUR DISTRICT, UPLAND USE LAND COVER AND NDVI OF MIRZAPUR DISTRICT, UP
LAND USE LAND COVER AND NDVI OF MIRZAPUR DISTRICT, UP
RAHUL
 
Liberal Approach to the Study of Indian Politics.pdf
Liberal Approach to the Study of Indian Politics.pdfLiberal Approach to the Study of Indian Politics.pdf
Liberal Approach to the Study of Indian Politics.pdf
WaniBasim
 
Life upper-Intermediate B2 Workbook for student
Life upper-Intermediate B2 Workbook for studentLife upper-Intermediate B2 Workbook for student
Life upper-Intermediate B2 Workbook for student
NgcHiNguyn25
 
Digital Artefact 1 - Tiny Home Environmental Design
Digital Artefact 1 - Tiny Home Environmental DesignDigital Artefact 1 - Tiny Home Environmental Design
Digital Artefact 1 - Tiny Home Environmental Design
amberjdewit93
 
How to Add Chatter in the odoo 17 ERP Module
How to Add Chatter in the odoo 17 ERP ModuleHow to Add Chatter in the odoo 17 ERP Module
How to Add Chatter in the odoo 17 ERP Module
Celine George
 
Walmart Business+ and Spark Good for Nonprofits.pdf
Walmart Business+ and Spark Good for Nonprofits.pdfWalmart Business+ and Spark Good for Nonprofits.pdf
Walmart Business+ and Spark Good for Nonprofits.pdf
TechSoup
 
How to Fix the Import Error in the Odoo 17
How to Fix the Import Error in the Odoo 17How to Fix the Import Error in the Odoo 17
How to Fix the Import Error in the Odoo 17
Celine George
 
PIMS Job Advertisement 2024.pdf Islamabad
PIMS Job Advertisement 2024.pdf IslamabadPIMS Job Advertisement 2024.pdf Islamabad
PIMS Job Advertisement 2024.pdf Islamabad
AyyanKhan40
 
How to Make a Field Mandatory in Odoo 17
How to Make a Field Mandatory in Odoo 17How to Make a Field Mandatory in Odoo 17
How to Make a Field Mandatory in Odoo 17
Celine George
 

Recently uploaded (20)

A Independência da América Espanhola LAPBOOK.pdf
A Independência da América Espanhola LAPBOOK.pdfA Independência da América Espanhola LAPBOOK.pdf
A Independência da América Espanhola LAPBOOK.pdf
 
The History of Stoke Newington Street Names
The History of Stoke Newington Street NamesThe History of Stoke Newington Street Names
The History of Stoke Newington Street Names
 
Azure Interview Questions and Answers PDF By ScholarHat
Azure Interview Questions and Answers PDF By ScholarHatAzure Interview Questions and Answers PDF By ScholarHat
Azure Interview Questions and Answers PDF By ScholarHat
 
writing about opinions about Australia the movie
writing about opinions about Australia the moviewriting about opinions about Australia the movie
writing about opinions about Australia the movie
 
RPMS TEMPLATE FOR SCHOOL YEAR 2023-2024 FOR TEACHER 1 TO TEACHER 3
RPMS TEMPLATE FOR SCHOOL YEAR 2023-2024 FOR TEACHER 1 TO TEACHER 3RPMS TEMPLATE FOR SCHOOL YEAR 2023-2024 FOR TEACHER 1 TO TEACHER 3
RPMS TEMPLATE FOR SCHOOL YEAR 2023-2024 FOR TEACHER 1 TO TEACHER 3
 
Main Java[All of the Base Concepts}.docx
Main Java[All of the Base Concepts}.docxMain Java[All of the Base Concepts}.docx
Main Java[All of the Base Concepts}.docx
 
ANATOMY AND BIOMECHANICS OF HIP JOINT.pdf
ANATOMY AND BIOMECHANICS OF HIP JOINT.pdfANATOMY AND BIOMECHANICS OF HIP JOINT.pdf
ANATOMY AND BIOMECHANICS OF HIP JOINT.pdf
 
clinical examination of hip joint (1).pdf
clinical examination of hip joint (1).pdfclinical examination of hip joint (1).pdf
clinical examination of hip joint (1).pdf
 
Hindi varnamala | hindi alphabet PPT.pdf
Hindi varnamala | hindi alphabet PPT.pdfHindi varnamala | hindi alphabet PPT.pdf
Hindi varnamala | hindi alphabet PPT.pdf
 
BBR 2024 Summer Sessions Interview Training
BBR  2024 Summer Sessions Interview TrainingBBR  2024 Summer Sessions Interview Training
BBR 2024 Summer Sessions Interview Training
 
Exploiting Artificial Intelligence for Empowering Researchers and Faculty, In...
Exploiting Artificial Intelligence for Empowering Researchers and Faculty, In...Exploiting Artificial Intelligence for Empowering Researchers and Faculty, In...
Exploiting Artificial Intelligence for Empowering Researchers and Faculty, In...
 
LAND USE LAND COVER AND NDVI OF MIRZAPUR DISTRICT, UP
LAND USE LAND COVER AND NDVI OF MIRZAPUR DISTRICT, UPLAND USE LAND COVER AND NDVI OF MIRZAPUR DISTRICT, UP
LAND USE LAND COVER AND NDVI OF MIRZAPUR DISTRICT, UP
 
Liberal Approach to the Study of Indian Politics.pdf
Liberal Approach to the Study of Indian Politics.pdfLiberal Approach to the Study of Indian Politics.pdf
Liberal Approach to the Study of Indian Politics.pdf
 
Life upper-Intermediate B2 Workbook for student
Life upper-Intermediate B2 Workbook for studentLife upper-Intermediate B2 Workbook for student
Life upper-Intermediate B2 Workbook for student
 
Digital Artefact 1 - Tiny Home Environmental Design
Digital Artefact 1 - Tiny Home Environmental DesignDigital Artefact 1 - Tiny Home Environmental Design
Digital Artefact 1 - Tiny Home Environmental Design
 
How to Add Chatter in the odoo 17 ERP Module
How to Add Chatter in the odoo 17 ERP ModuleHow to Add Chatter in the odoo 17 ERP Module
How to Add Chatter in the odoo 17 ERP Module
 
Walmart Business+ and Spark Good for Nonprofits.pdf
Walmart Business+ and Spark Good for Nonprofits.pdfWalmart Business+ and Spark Good for Nonprofits.pdf
Walmart Business+ and Spark Good for Nonprofits.pdf
 
How to Fix the Import Error in the Odoo 17
How to Fix the Import Error in the Odoo 17How to Fix the Import Error in the Odoo 17
How to Fix the Import Error in the Odoo 17
 
PIMS Job Advertisement 2024.pdf Islamabad
PIMS Job Advertisement 2024.pdf IslamabadPIMS Job Advertisement 2024.pdf Islamabad
PIMS Job Advertisement 2024.pdf Islamabad
 
How to Make a Field Mandatory in Odoo 17
How to Make a Field Mandatory in Odoo 17How to Make a Field Mandatory in Odoo 17
How to Make a Field Mandatory in Odoo 17
 

Fibonacci surce code

  • 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