SlideShare ist ein Scribd-Unternehmen logo
1 von 2
/* Write a recursive function to obtain the first 25 numbers of a
Fibonacci sequence. In a Fibonacci sequence the sum of two successive
terms gives the third term. Following are the first few terms of the
Fibonacci sequence:
1 1 2 3 5 8 13 21 34 55 89... */
#include<stdio.h>
#include<conio.h>
void main()
{
clrscr();
unsigned i,n=25,a=1,fib;
for(i=0;i<n;i++) {
printf("%u ",fib*a);
a++;
}
getch();
}
fib(unsigned n) {
if(n==0)
return 0;
if(n==1)
return 1;
else
return fib(n-1)+fib(n-2);
}
Out Put
/* A 5-digit positive integer is entered through the keyboard, write a
function to calculate sum of digits of the 5-digit number:
(1) Without using recursion
(2) Using recursion */
#include<stdio.h>
#include<conio.h>
void main()
{
clrscr();
long int n,s=0,b,sum;
printf("Enter any 5-digit number: ");
scanf("%ld",&n);
printf("nnChoose : 1: sum of digits without recursivelynn");
printf("Or Choose : 2: sum of digits recursivelynnn");
printf("Your choice is = ");
b=getche();
switch(b) {
case '1':
while(n!=0) {
s=s+(n%10);
n=n/10;
}
printf("nnnThe sum of digits is = %dn",s);
break;
case '2':
s=sum+n;
printf("nnnThe Sum of digits is = %dn",s);
break;
}
getch();
}
sum(long n) {
static s=0;
if(n==0)
return s;
else {
s=s+n%10;
n=sum(n/10);
return n;
}
}
Out Put

Weitere Àhnliche Inhalte

Was ist angesagt?

Bcsl 033 data and file structures lab s5-3
Bcsl 033 data and file structures lab s5-3Bcsl 033 data and file structures lab s5-3
Bcsl 033 data and file structures lab s5-3Dr. Loganathan R
 
Recursion concepts by Divya
Recursion concepts by DivyaRecursion concepts by Divya
Recursion concepts by DivyaDivya Kumari
 
Bcsl 033 data and file structures lab s3-3
Bcsl 033 data and file structures lab s3-3Bcsl 033 data and file structures lab s3-3
Bcsl 033 data and file structures lab s3-3Dr. Loganathan R
 
Stack concepts by Divya
Stack concepts by DivyaStack concepts by Divya
Stack concepts by DivyaDivya Kumari
 
Implement a queue using two stacks.
Implement a queue using two stacks.Implement a queue using two stacks.
Implement a queue using two stacks.Dr. Loganathan R
 
A formalization of complex event stream processing
A formalization of complex event stream processingA formalization of complex event stream processing
A formalization of complex event stream processingSylvain Hallé
 
Prime number program in c
Prime number program in cPrime number program in c
Prime number program in cHitesh Kumar
 
Write a program to check a given number is prime or not
Write a program to check a given number is prime or notWrite a program to check a given number is prime or not
Write a program to check a given number is prime or notaluavi
 
Bcsl 033 data and file structures lab s2-2
Bcsl 033 data and file structures lab s2-2Bcsl 033 data and file structures lab s2-2
Bcsl 033 data and file structures lab s2-2Dr. Loganathan R
 
Linked list2
Linked list2Linked list2
Linked list2Indrani Sen
 
My lecture infix-to-postfix
My lecture infix-to-postfixMy lecture infix-to-postfix
My lecture infix-to-postfixSenthil Kumar
 
Bcsl 033 data and file structures lab s1-3
Bcsl 033 data and file structures lab s1-3Bcsl 033 data and file structures lab s1-3
Bcsl 033 data and file structures lab s1-3Dr. Loganathan R
 
Bti1022 lab sheet 9 10
Bti1022 lab sheet 9 10Bti1022 lab sheet 9 10
Bti1022 lab sheet 9 10alish sha
 
Bcsl 033 data and file structures lab s1-1
Bcsl 033 data and file structures lab s1-1Bcsl 033 data and file structures lab s1-1
Bcsl 033 data and file structures lab s1-1Dr. Loganathan R
 
Bcsl 033 data and file structures lab s1-4
Bcsl 033 data and file structures lab s1-4Bcsl 033 data and file structures lab s1-4
Bcsl 033 data and file structures lab s1-4Dr. Loganathan R
 
Bcsl 033 data and file structures lab s5-2
Bcsl 033 data and file structures lab s5-2Bcsl 033 data and file structures lab s5-2
Bcsl 033 data and file structures lab s5-2Dr. Loganathan R
 
Dti2143 lab sheet 9
Dti2143 lab sheet 9Dti2143 lab sheet 9
Dti2143 lab sheet 9alish sha
 
Program in ‘C’ language to implement linear search using pointers
Program in ‘C’ language to implement linear search using pointersProgram in ‘C’ language to implement linear search using pointers
Program in ‘C’ language to implement linear search using pointersDr. Loganathan R
 
Matlab project
Matlab projectMatlab project
Matlab projectiftikhar ali
 

Was ist angesagt? (20)

Bcsl 033 data and file structures lab s5-3
Bcsl 033 data and file structures lab s5-3Bcsl 033 data and file structures lab s5-3
Bcsl 033 data and file structures lab s5-3
 
Recursion concepts by Divya
Recursion concepts by DivyaRecursion concepts by Divya
Recursion concepts by Divya
 
Bcsl 033 data and file structures lab s3-3
Bcsl 033 data and file structures lab s3-3Bcsl 033 data and file structures lab s3-3
Bcsl 033 data and file structures lab s3-3
 
Stack concepts by Divya
Stack concepts by DivyaStack concepts by Divya
Stack concepts by Divya
 
Implement a queue using two stacks.
Implement a queue using two stacks.Implement a queue using two stacks.
Implement a queue using two stacks.
 
A formalization of complex event stream processing
A formalization of complex event stream processingA formalization of complex event stream processing
A formalization of complex event stream processing
 
Prime number program in c
Prime number program in cPrime number program in c
Prime number program in c
 
Write a program to check a given number is prime or not
Write a program to check a given number is prime or notWrite a program to check a given number is prime or not
Write a program to check a given number is prime or not
 
Bcsl 033 data and file structures lab s2-2
Bcsl 033 data and file structures lab s2-2Bcsl 033 data and file structures lab s2-2
Bcsl 033 data and file structures lab s2-2
 
Linked list2
Linked list2Linked list2
Linked list2
 
My lecture infix-to-postfix
My lecture infix-to-postfixMy lecture infix-to-postfix
My lecture infix-to-postfix
 
Bcsl 033 data and file structures lab s1-3
Bcsl 033 data and file structures lab s1-3Bcsl 033 data and file structures lab s1-3
Bcsl 033 data and file structures lab s1-3
 
Bti1022 lab sheet 9 10
Bti1022 lab sheet 9 10Bti1022 lab sheet 9 10
Bti1022 lab sheet 9 10
 
Bcsl 033 data and file structures lab s1-1
Bcsl 033 data and file structures lab s1-1Bcsl 033 data and file structures lab s1-1
Bcsl 033 data and file structures lab s1-1
 
Bcsl 033 data and file structures lab s1-4
Bcsl 033 data and file structures lab s1-4Bcsl 033 data and file structures lab s1-4
Bcsl 033 data and file structures lab s1-4
 
Bcsl 033 data and file structures lab s5-2
Bcsl 033 data and file structures lab s5-2Bcsl 033 data and file structures lab s5-2
Bcsl 033 data and file structures lab s5-2
 
Dti2143 lab sheet 9
Dti2143 lab sheet 9Dti2143 lab sheet 9
Dti2143 lab sheet 9
 
Program in ‘C’ language to implement linear search using pointers
Program in ‘C’ language to implement linear search using pointersProgram in ‘C’ language to implement linear search using pointers
Program in ‘C’ language to implement linear search using pointers
 
Matlab project
Matlab projectMatlab project
Matlab project
 
Ansi c
Ansi cAnsi c
Ansi c
 

Andere mochten auch

Avcm content flow_080608-v2
Avcm content flow_080608-v2Avcm content flow_080608-v2
Avcm content flow_080608-v2Debjani Roy
 
БРОйУРА 20 ГОДИНИ ЗА ДЕЩАбА - ПРВА ДЕбСКА АМБАСАДА ВО СВЕбОб МЕЃАйИ 1992-2012
БРОйУРА 20 ГОДИНИ ЗА ДЕЩАбА - ПРВА ДЕбСКА АМБАСАДА ВО СВЕбОб МЕЃАйИ 1992-2012БРОйУРА 20 ГОДИНИ ЗА ДЕЩАбА - ПРВА ДЕбСКА АМБАСАДА ВО СВЕбОб МЕЃАйИ 1992-2012
БРОйУРА 20 ГОДИНИ ЗА ДЕЩАбА - ПРВА ДЕбСКА АМБАСАДА ВО СВЕбОб МЕЃАйИ 1992-2012FIRST CHILDREN'S EMBASSY IN THE WORLD MEGJASHI
 
Jaypee Boomerang Residency 9999963844 JP Boomerang Residency
Jaypee Boomerang Residency 9999963844 JP Boomerang ResidencyJaypee Boomerang Residency 9999963844 JP Boomerang Residency
Jaypee Boomerang Residency 9999963844 JP Boomerang ResidencyJaypee Chambers Noida
 
Arefjev text
Arefjev textArefjev text
Arefjev texteid1
 
RUCUG: 9. Sergey Khalyapin: ĐŸŃ€Đ”ĐŽŃŃ‚Đ°ĐČĐ»ŃĐ”ĐŒ XenDesktop 5
RUCUG: 9. Sergey Khalyapin: ĐŸŃ€Đ”ĐŽŃŃ‚Đ°ĐČĐ»ŃĐ”ĐŒ XenDesktop 5RUCUG: 9. Sergey Khalyapin: ĐŸŃ€Đ”ĐŽŃŃ‚Đ°ĐČĐ»ŃĐ”ĐŒ XenDesktop 5
RUCUG: 9. Sergey Khalyapin: ĐŸŃ€Đ”ĐŽŃŃ‚Đ°ĐČĐ»ŃĐ”ĐŒ XenDesktop 5Denis Gundarev
 
VirtuĂĄlis tanulĂĄsi tĂ©r kialakĂ­tĂĄsa az Öveges JĂłzsef SzakkĂ©pzƑ IskolĂĄban
VirtuĂĄlis tanulĂĄsi tĂ©r kialakĂ­tĂĄsa az Öveges JĂłzsef SzakkĂ©pzƑ IskolĂĄbanVirtuĂĄlis tanulĂĄsi tĂ©r kialakĂ­tĂĄsa az Öveges JĂłzsef SzakkĂ©pzƑ IskolĂĄban
VirtuĂĄlis tanulĂĄsi tĂ©r kialakĂ­tĂĄsa az Öveges JĂłzsef SzakkĂ©pzƑ IskolĂĄbanArpad Banhidi
 
Telangana solar RFS Document 2014
Telangana solar RFS Document 2014Telangana solar RFS Document 2014
Telangana solar RFS Document 2014Headway Solar
 
GUSII MWALIMU SACCO TENDER DOCUMENTS 2015_2016
GUSII MWALIMU SACCO TENDER DOCUMENTS 2015_2016GUSII MWALIMU SACCO TENDER DOCUMENTS 2015_2016
GUSII MWALIMU SACCO TENDER DOCUMENTS 2015_2016Collo Juma
 
Jamaludin - Proses pada Sistem Operasi
Jamaludin - Proses pada Sistem OperasiJamaludin - Proses pada Sistem Operasi
Jamaludin - Proses pada Sistem Operasibelajarkomputer
 
Absinthe
AbsintheAbsinthe
Absintheoman2g
 
Unit 7 lesson d
Unit 7  lesson dUnit 7  lesson d
Unit 7 lesson dluz adriana
 
National geographic interactive january 2015
National geographic interactive january 2015 National geographic interactive january 2015
National geographic interactive january 2015 justreleasedpdfs
 

Andere mochten auch (15)

Avcm content flow_080608-v2
Avcm content flow_080608-v2Avcm content flow_080608-v2
Avcm content flow_080608-v2
 
БРОйУРА 20 ГОДИНИ ЗА ДЕЩАбА - ПРВА ДЕбСКА АМБАСАДА ВО СВЕбОб МЕЃАйИ 1992-2012
БРОйУРА 20 ГОДИНИ ЗА ДЕЩАбА - ПРВА ДЕбСКА АМБАСАДА ВО СВЕбОб МЕЃАйИ 1992-2012БРОйУРА 20 ГОДИНИ ЗА ДЕЩАбА - ПРВА ДЕбСКА АМБАСАДА ВО СВЕбОб МЕЃАйИ 1992-2012
БРОйУРА 20 ГОДИНИ ЗА ДЕЩАбА - ПРВА ДЕбСКА АМБАСАДА ВО СВЕбОб МЕЃАйИ 1992-2012
 
Jaypee Boomerang Residency 9999963844 JP Boomerang Residency
Jaypee Boomerang Residency 9999963844 JP Boomerang ResidencyJaypee Boomerang Residency 9999963844 JP Boomerang Residency
Jaypee Boomerang Residency 9999963844 JP Boomerang Residency
 
Arefjev text
Arefjev textArefjev text
Arefjev text
 
RUCUG: 9. Sergey Khalyapin: ĐŸŃ€Đ”ĐŽŃŃ‚Đ°ĐČĐ»ŃĐ”ĐŒ XenDesktop 5
RUCUG: 9. Sergey Khalyapin: ĐŸŃ€Đ”ĐŽŃŃ‚Đ°ĐČĐ»ŃĐ”ĐŒ XenDesktop 5RUCUG: 9. Sergey Khalyapin: ĐŸŃ€Đ”ĐŽŃŃ‚Đ°ĐČĐ»ŃĐ”ĐŒ XenDesktop 5
RUCUG: 9. Sergey Khalyapin: ĐŸŃ€Đ”ĐŽŃŃ‚Đ°ĐČĐ»ŃĐ”ĐŒ XenDesktop 5
 
VirtuĂĄlis tanulĂĄsi tĂ©r kialakĂ­tĂĄsa az Öveges JĂłzsef SzakkĂ©pzƑ IskolĂĄban
VirtuĂĄlis tanulĂĄsi tĂ©r kialakĂ­tĂĄsa az Öveges JĂłzsef SzakkĂ©pzƑ IskolĂĄbanVirtuĂĄlis tanulĂĄsi tĂ©r kialakĂ­tĂĄsa az Öveges JĂłzsef SzakkĂ©pzƑ IskolĂĄban
VirtuĂĄlis tanulĂĄsi tĂ©r kialakĂ­tĂĄsa az Öveges JĂłzsef SzakkĂ©pzƑ IskolĂĄban
 
SDPI Political Barometer Phase-II
SDPI Political Barometer Phase-IISDPI Political Barometer Phase-II
SDPI Political Barometer Phase-II
 
Telangana solar RFS Document 2014
Telangana solar RFS Document 2014Telangana solar RFS Document 2014
Telangana solar RFS Document 2014
 
GUSII MWALIMU SACCO TENDER DOCUMENTS 2015_2016
GUSII MWALIMU SACCO TENDER DOCUMENTS 2015_2016GUSII MWALIMU SACCO TENDER DOCUMENTS 2015_2016
GUSII MWALIMU SACCO TENDER DOCUMENTS 2015_2016
 
En trak
En trakEn trak
En trak
 
Jamaludin - Proses pada Sistem Operasi
Jamaludin - Proses pada Sistem OperasiJamaludin - Proses pada Sistem Operasi
Jamaludin - Proses pada Sistem Operasi
 
Absinthe
AbsintheAbsinthe
Absinthe
 
Avoid warts this summer
Avoid warts this summerAvoid warts this summer
Avoid warts this summer
 
Unit 7 lesson d
Unit 7  lesson dUnit 7  lesson d
Unit 7 lesson d
 
National geographic interactive january 2015
National geographic interactive january 2015 National geographic interactive january 2015
National geographic interactive january 2015
 

Ähnlich wie New microsoft office word document (2)

Presentation 6 (1).pptx
Presentation 6 (1).pptxPresentation 6 (1).pptx
Presentation 6 (1).pptxSagarGhosh48
 
week4_python.docx
week4_python.docxweek4_python.docx
week4_python.docxRadhe Syam
 
PRACTICAL FILE(COMP SC).pptx
PRACTICAL FILE(COMP SC).pptxPRACTICAL FILE(COMP SC).pptx
PRACTICAL FILE(COMP SC).pptxAbhinavGupta257043
 
PYTHON_PROGRAM(1-34).pdf
PYTHON_PROGRAM(1-34).pdfPYTHON_PROGRAM(1-34).pdf
PYTHON_PROGRAM(1-34).pdfNeeraj381934
 
Computer programming subject notes. Quick easy notes for C Programming.Cheat ...
Computer programming subject notes. Quick easy notes for C Programming.Cheat ...Computer programming subject notes. Quick easy notes for C Programming.Cheat ...
Computer programming subject notes. Quick easy notes for C Programming.Cheat ...DR B.Surendiran .
 
Task4output.txt 2 5 9 13 15 10 1 0 3 7 11 14 1.docx
Task4output.txt 2  5  9 13 15 10  1  0  3  7 11 14 1.docxTask4output.txt 2  5  9 13 15 10  1  0  3  7 11 14 1.docx
Task4output.txt 2 5 9 13 15 10 1 0 3 7 11 14 1.docxjosies1
 
Hello. This program has to be done in Eclipse(Program used to write .pdf
Hello. This program has to be done in Eclipse(Program used to write .pdfHello. This program has to be done in Eclipse(Program used to write .pdf
Hello. This program has to be done in Eclipse(Program used to write .pdfarchiesgallery
 
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-ee01083101premrings
 
Algorithms with-java-1.0
Algorithms with-java-1.0Algorithms with-java-1.0
Algorithms with-java-1.0BG Java EE Course
 
Functions Practice Sheet.docx
Functions Practice Sheet.docxFunctions Practice Sheet.docx
Functions Practice Sheet.docxSwatiMishra364461
 
PROGRAMMING IN C EXAMPLE PROGRAMS FOR NEW LEARNERS - SARASWATHI RAMALINGAM
PROGRAMMING IN C EXAMPLE PROGRAMS FOR NEW LEARNERS  - SARASWATHI RAMALINGAMPROGRAMMING IN C EXAMPLE PROGRAMS FOR NEW LEARNERS  - SARASWATHI RAMALINGAM
PROGRAMMING IN C EXAMPLE PROGRAMS FOR NEW LEARNERS - SARASWATHI RAMALINGAMSaraswathiRamalingam
 
Assignment no 5
Assignment no 5Assignment no 5
Assignment no 5nancydrews
 
ch05-program-logic-indefinite-loops.ppt
ch05-program-logic-indefinite-loops.pptch05-program-logic-indefinite-loops.ppt
ch05-program-logic-indefinite-loops.pptMahyuddin8
 
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
 
USER DEFINE FUNCTIONS IN PYTHON[WITH PARAMETERS]
USER DEFINE FUNCTIONS IN PYTHON[WITH PARAMETERS]USER DEFINE FUNCTIONS IN PYTHON[WITH PARAMETERS]
USER DEFINE FUNCTIONS IN PYTHON[WITH PARAMETERS]vikram mahendra
 
B.Com 1year Lab programs
B.Com 1year Lab programsB.Com 1year Lab programs
B.Com 1year Lab programsPrasadu Peddi
 
Use Python Code to add a block of code to count the number of dots wit.pdf
Use Python Code to add a block of code to count the number of dots wit.pdfUse Python Code to add a block of code to count the number of dots wit.pdf
Use Python Code to add a block of code to count the number of dots wit.pdfaonetechcomputers
 
Practical write a c program to reverse a given number
Practical write a c program to reverse a given numberPractical write a c program to reverse a given number
Practical write a c program to reverse a given numberMainak Sasmal
 

Ähnlich wie New microsoft office word document (2) (20)

Presentation 6 (1).pptx
Presentation 6 (1).pptxPresentation 6 (1).pptx
Presentation 6 (1).pptx
 
week4_python.docx
week4_python.docxweek4_python.docx
week4_python.docx
 
PRACTICAL FILE(COMP SC).pptx
PRACTICAL FILE(COMP SC).pptxPRACTICAL FILE(COMP SC).pptx
PRACTICAL FILE(COMP SC).pptx
 
PYTHON_PROGRAM(1-34).pdf
PYTHON_PROGRAM(1-34).pdfPYTHON_PROGRAM(1-34).pdf
PYTHON_PROGRAM(1-34).pdf
 
Functions
FunctionsFunctions
Functions
 
Computer programming subject notes. Quick easy notes for C Programming.Cheat ...
Computer programming subject notes. Quick easy notes for C Programming.Cheat ...Computer programming subject notes. Quick easy notes for C Programming.Cheat ...
Computer programming subject notes. Quick easy notes for C Programming.Cheat ...
 
Task4output.txt 2 5 9 13 15 10 1 0 3 7 11 14 1.docx
Task4output.txt 2  5  9 13 15 10  1  0  3  7 11 14 1.docxTask4output.txt 2  5  9 13 15 10  1  0  3  7 11 14 1.docx
Task4output.txt 2 5 9 13 15 10 1 0 3 7 11 14 1.docx
 
C-LOOP-Session-2.pptx
C-LOOP-Session-2.pptxC-LOOP-Session-2.pptx
C-LOOP-Session-2.pptx
 
Hello. This program has to be done in Eclipse(Program used to write .pdf
Hello. This program has to be done in Eclipse(Program used to write .pdfHello. This program has to be done in Eclipse(Program used to write .pdf
Hello. This program has to be done in Eclipse(Program used to write .pdf
 
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
 
Algorithms with-java-1.0
Algorithms with-java-1.0Algorithms with-java-1.0
Algorithms with-java-1.0
 
Functions Practice Sheet.docx
Functions Practice Sheet.docxFunctions Practice Sheet.docx
Functions Practice Sheet.docx
 
PROGRAMMING IN C EXAMPLE PROGRAMS FOR NEW LEARNERS - SARASWATHI RAMALINGAM
PROGRAMMING IN C EXAMPLE PROGRAMS FOR NEW LEARNERS  - SARASWATHI RAMALINGAMPROGRAMMING IN C EXAMPLE PROGRAMS FOR NEW LEARNERS  - SARASWATHI RAMALINGAM
PROGRAMMING IN C EXAMPLE PROGRAMS FOR NEW LEARNERS - SARASWATHI RAMALINGAM
 
Assignment no 5
Assignment no 5Assignment no 5
Assignment no 5
 
ch05-program-logic-indefinite-loops.ppt
ch05-program-logic-indefinite-loops.pptch05-program-logic-indefinite-loops.ppt
ch05-program-logic-indefinite-loops.ppt
 
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
 
USER DEFINE FUNCTIONS IN PYTHON[WITH PARAMETERS]
USER DEFINE FUNCTIONS IN PYTHON[WITH PARAMETERS]USER DEFINE FUNCTIONS IN PYTHON[WITH PARAMETERS]
USER DEFINE FUNCTIONS IN PYTHON[WITH PARAMETERS]
 
B.Com 1year Lab programs
B.Com 1year Lab programsB.Com 1year Lab programs
B.Com 1year Lab programs
 
Use Python Code to add a block of code to count the number of dots wit.pdf
Use Python Code to add a block of code to count the number of dots wit.pdfUse Python Code to add a block of code to count the number of dots wit.pdf
Use Python Code to add a block of code to count the number of dots wit.pdf
 
Practical write a c program to reverse a given number
Practical write a c program to reverse a given numberPractical write a c program to reverse a given number
Practical write a c program to reverse a given number
 

Mehr von Syed Umair

Assignement code
Assignement codeAssignement code
Assignement codeSyed Umair
 
Title page
Title pageTitle page
Title pageSyed Umair
 
Perception
PerceptionPerception
PerceptionSyed Umair
 
New microsoft office word document
New microsoft office word documentNew microsoft office word document
New microsoft office word documentSyed Umair
 
Assignement of programming & problem solving
Assignement of programming & problem solvingAssignement of programming & problem solving
Assignement of programming & problem solvingSyed Umair
 
Assignement of discrete mathematics
Assignement of discrete mathematicsAssignement of discrete mathematics
Assignement of discrete mathematicsSyed Umair
 
Assignment c++12
Assignment c++12Assignment c++12
Assignment c++12Syed Umair
 
Assignement of discrete mathematics
Assignement of discrete mathematicsAssignement of discrete mathematics
Assignement of discrete mathematicsSyed Umair
 
Assignement c++
Assignement c++Assignement c++
Assignement c++Syed Umair
 
Truth table a.r
Truth table a.rTruth table a.r
Truth table a.rSyed Umair
 

Mehr von Syed Umair (20)

Assignement code
Assignement codeAssignement code
Assignement code
 
Tree 4
Tree 4Tree 4
Tree 4
 
Title page
Title pageTitle page
Title page
 
S.k
S.kS.k
S.k
 
Q.a
Q.aQ.a
Q.a
 
Prog
ProgProg
Prog
 
Perception
PerceptionPerception
Perception
 
New microsoft office word document
New microsoft office word documentNew microsoft office word document
New microsoft office word document
 
M.b
M.bM.b
M.b
 
C++ 4
C++ 4C++ 4
C++ 4
 
B.g
B.gB.g
B.g
 
Assignement of programming & problem solving
Assignement of programming & problem solvingAssignement of programming & problem solving
Assignement of programming & problem solving
 
Assignement of discrete mathematics
Assignement of discrete mathematicsAssignement of discrete mathematics
Assignement of discrete mathematics
 
A.i
A.iA.i
A.i
 
H m
H mH m
H m
 
Prog
ProgProg
Prog
 
Assignment c++12
Assignment c++12Assignment c++12
Assignment c++12
 
Assignement of discrete mathematics
Assignement of discrete mathematicsAssignement of discrete mathematics
Assignement of discrete mathematics
 
Assignement c++
Assignement c++Assignement c++
Assignement c++
 
Truth table a.r
Truth table a.rTruth table a.r
Truth table a.r
 

KĂŒrzlich hochgeladen

Like-prefer-love -hate+verb+ing & silent letters & citizenship text.pdf
Like-prefer-love -hate+verb+ing & silent letters & citizenship text.pdfLike-prefer-love -hate+verb+ing & silent letters & citizenship text.pdf
Like-prefer-love -hate+verb+ing & silent letters & citizenship text.pdfMr Bounab Samir
 
Choosing the Right CBSE School A Comprehensive Guide for Parents
Choosing the Right CBSE School A Comprehensive Guide for ParentsChoosing the Right CBSE School A Comprehensive Guide for Parents
Choosing the Right CBSE School A Comprehensive Guide for Parentsnavabharathschool99
 
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPT
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPTECONOMIC CONTEXT - LONG FORM TV DRAMA - PPT
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPTiammrhaywood
 
ANG SEKTOR NG agrikultura.pptx QUARTER 4
ANG SEKTOR NG agrikultura.pptx QUARTER 4ANG SEKTOR NG agrikultura.pptx QUARTER 4
ANG SEKTOR NG agrikultura.pptx QUARTER 4MiaBumagat1
 
INTRODUCTION TO CATHOLIC CHRISTOLOGY.pptx
INTRODUCTION TO CATHOLIC CHRISTOLOGY.pptxINTRODUCTION TO CATHOLIC CHRISTOLOGY.pptx
INTRODUCTION TO CATHOLIC CHRISTOLOGY.pptxHumphrey A Beña
 
Earth Day Presentation wow hello nice great
Earth Day Presentation wow hello nice greatEarth Day Presentation wow hello nice great
Earth Day Presentation wow hello nice greatYousafMalik24
 
Inclusivity Essentials_ Creating Accessible Websites for Nonprofits .pdf
Inclusivity Essentials_ Creating Accessible Websites for Nonprofits .pdfInclusivity Essentials_ Creating Accessible Websites for Nonprofits .pdf
Inclusivity Essentials_ Creating Accessible Websites for Nonprofits .pdfTechSoup
 
Judging the Relevance and worth of ideas part 2.pptx
Judging the Relevance  and worth of ideas part 2.pptxJudging the Relevance  and worth of ideas part 2.pptx
Judging the Relevance and worth of ideas part 2.pptxSherlyMaeNeri
 
Full Stack Web Development Course for Beginners
Full Stack Web Development Course  for BeginnersFull Stack Web Development Course  for Beginners
Full Stack Web Development Course for BeginnersSabitha Banu
 
ENGLISH 7_Q4_LESSON 2_ Employing a Variety of Strategies for Effective Interp...
ENGLISH 7_Q4_LESSON 2_ Employing a Variety of Strategies for Effective Interp...ENGLISH 7_Q4_LESSON 2_ Employing a Variety of Strategies for Effective Interp...
ENGLISH 7_Q4_LESSON 2_ Employing a Variety of Strategies for Effective Interp...JhezDiaz1
 
ACC 2024 Chronicles. Cardiology. Exam.pdf
ACC 2024 Chronicles. Cardiology. Exam.pdfACC 2024 Chronicles. Cardiology. Exam.pdf
ACC 2024 Chronicles. Cardiology. Exam.pdfSpandanaRallapalli
 
Science 7 Quarter 4 Module 2: Natural Resources.pptx
Science 7 Quarter 4 Module 2: Natural Resources.pptxScience 7 Quarter 4 Module 2: Natural Resources.pptx
Science 7 Quarter 4 Module 2: Natural Resources.pptxMaryGraceBautista27
 
Visit to a blind student's school🧑‍🩯🧑‍🩯(community medicine)
Visit to a blind student's school🧑‍🩯🧑‍🩯(community medicine)Visit to a blind student's school🧑‍🩯🧑‍🩯(community medicine)
Visit to a blind student's school🧑‍🩯🧑‍🩯(community medicine)lakshayb543
 
HỌC TỐT TIáșŸNG ANH 11 THEO CHÆŻÆ NG TRÌNH GLOBAL SUCCESS ĐÁP ÁN CHI TIáșŸT - Cáșą NĂ...
HỌC TỐT TIáșŸNG ANH 11 THEO CHÆŻÆ NG TRÌNH GLOBAL SUCCESS ĐÁP ÁN CHI TIáșŸT - Cáșą NĂ...HỌC TỐT TIáșŸNG ANH 11 THEO CHÆŻÆ NG TRÌNH GLOBAL SUCCESS ĐÁP ÁN CHI TIáșŸT - Cáșą NĂ...
HỌC TỐT TIáșŸNG ANH 11 THEO CHÆŻÆ NG TRÌNH GLOBAL SUCCESS ĐÁP ÁN CHI TIáșŸT - Cáșą NĂ...Nguyen Thanh Tu Collection
 
MULTIDISCIPLINRY NATURE OF THE ENVIRONMENTAL STUDIES.pptx
MULTIDISCIPLINRY NATURE OF THE ENVIRONMENTAL STUDIES.pptxMULTIDISCIPLINRY NATURE OF THE ENVIRONMENTAL STUDIES.pptx
MULTIDISCIPLINRY NATURE OF THE ENVIRONMENTAL STUDIES.pptxAnupkumar Sharma
 
4.18.24 Movement Legacies, Reflection, and Review.pptx
4.18.24 Movement Legacies, Reflection, and Review.pptx4.18.24 Movement Legacies, Reflection, and Review.pptx
4.18.24 Movement Legacies, Reflection, and Review.pptxmary850239
 
How to do quick user assign in kanban in Odoo 17 ERP
How to do quick user assign in kanban in Odoo 17 ERPHow to do quick user assign in kanban in Odoo 17 ERP
How to do quick user assign in kanban in Odoo 17 ERPCeline George
 
Barangay Council for the Protection of Children (BCPC) Orientation.pptx
Barangay Council for the Protection of Children (BCPC) Orientation.pptxBarangay Council for the Protection of Children (BCPC) Orientation.pptx
Barangay Council for the Protection of Children (BCPC) Orientation.pptxCarlos105
 

KĂŒrzlich hochgeladen (20)

Like-prefer-love -hate+verb+ing & silent letters & citizenship text.pdf
Like-prefer-love -hate+verb+ing & silent letters & citizenship text.pdfLike-prefer-love -hate+verb+ing & silent letters & citizenship text.pdf
Like-prefer-love -hate+verb+ing & silent letters & citizenship text.pdf
 
Choosing the Right CBSE School A Comprehensive Guide for Parents
Choosing the Right CBSE School A Comprehensive Guide for ParentsChoosing the Right CBSE School A Comprehensive Guide for Parents
Choosing the Right CBSE School A Comprehensive Guide for Parents
 
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPT
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPTECONOMIC CONTEXT - LONG FORM TV DRAMA - PPT
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPT
 
ANG SEKTOR NG agrikultura.pptx QUARTER 4
ANG SEKTOR NG agrikultura.pptx QUARTER 4ANG SEKTOR NG agrikultura.pptx QUARTER 4
ANG SEKTOR NG agrikultura.pptx QUARTER 4
 
INTRODUCTION TO CATHOLIC CHRISTOLOGY.pptx
INTRODUCTION TO CATHOLIC CHRISTOLOGY.pptxINTRODUCTION TO CATHOLIC CHRISTOLOGY.pptx
INTRODUCTION TO CATHOLIC CHRISTOLOGY.pptx
 
Earth Day Presentation wow hello nice great
Earth Day Presentation wow hello nice greatEarth Day Presentation wow hello nice great
Earth Day Presentation wow hello nice great
 
Inclusivity Essentials_ Creating Accessible Websites for Nonprofits .pdf
Inclusivity Essentials_ Creating Accessible Websites for Nonprofits .pdfInclusivity Essentials_ Creating Accessible Websites for Nonprofits .pdf
Inclusivity Essentials_ Creating Accessible Websites for Nonprofits .pdf
 
Judging the Relevance and worth of ideas part 2.pptx
Judging the Relevance  and worth of ideas part 2.pptxJudging the Relevance  and worth of ideas part 2.pptx
Judging the Relevance and worth of ideas part 2.pptx
 
Full Stack Web Development Course for Beginners
Full Stack Web Development Course  for BeginnersFull Stack Web Development Course  for Beginners
Full Stack Web Development Course for Beginners
 
ENGLISH 7_Q4_LESSON 2_ Employing a Variety of Strategies for Effective Interp...
ENGLISH 7_Q4_LESSON 2_ Employing a Variety of Strategies for Effective Interp...ENGLISH 7_Q4_LESSON 2_ Employing a Variety of Strategies for Effective Interp...
ENGLISH 7_Q4_LESSON 2_ Employing a Variety of Strategies for Effective Interp...
 
ACC 2024 Chronicles. Cardiology. Exam.pdf
ACC 2024 Chronicles. Cardiology. Exam.pdfACC 2024 Chronicles. Cardiology. Exam.pdf
ACC 2024 Chronicles. Cardiology. Exam.pdf
 
Science 7 Quarter 4 Module 2: Natural Resources.pptx
Science 7 Quarter 4 Module 2: Natural Resources.pptxScience 7 Quarter 4 Module 2: Natural Resources.pptx
Science 7 Quarter 4 Module 2: Natural Resources.pptx
 
Visit to a blind student's school🧑‍🩯🧑‍🩯(community medicine)
Visit to a blind student's school🧑‍🩯🧑‍🩯(community medicine)Visit to a blind student's school🧑‍🩯🧑‍🩯(community medicine)
Visit to a blind student's school🧑‍🩯🧑‍🩯(community medicine)
 
HỌC TỐT TIáșŸNG ANH 11 THEO CHÆŻÆ NG TRÌNH GLOBAL SUCCESS ĐÁP ÁN CHI TIáșŸT - Cáșą NĂ...
HỌC TỐT TIáșŸNG ANH 11 THEO CHÆŻÆ NG TRÌNH GLOBAL SUCCESS ĐÁP ÁN CHI TIáșŸT - Cáșą NĂ...HỌC TỐT TIáșŸNG ANH 11 THEO CHÆŻÆ NG TRÌNH GLOBAL SUCCESS ĐÁP ÁN CHI TIáșŸT - Cáșą NĂ...
HỌC TỐT TIáșŸNG ANH 11 THEO CHÆŻÆ NG TRÌNH GLOBAL SUCCESS ĐÁP ÁN CHI TIáșŸT - Cáșą NĂ...
 
Raw materials used in Herbal Cosmetics.pptx
Raw materials used in Herbal Cosmetics.pptxRaw materials used in Herbal Cosmetics.pptx
Raw materials used in Herbal Cosmetics.pptx
 
MULTIDISCIPLINRY NATURE OF THE ENVIRONMENTAL STUDIES.pptx
MULTIDISCIPLINRY NATURE OF THE ENVIRONMENTAL STUDIES.pptxMULTIDISCIPLINRY NATURE OF THE ENVIRONMENTAL STUDIES.pptx
MULTIDISCIPLINRY NATURE OF THE ENVIRONMENTAL STUDIES.pptx
 
4.18.24 Movement Legacies, Reflection, and Review.pptx
4.18.24 Movement Legacies, Reflection, and Review.pptx4.18.24 Movement Legacies, Reflection, and Review.pptx
4.18.24 Movement Legacies, Reflection, and Review.pptx
 
How to do quick user assign in kanban in Odoo 17 ERP
How to do quick user assign in kanban in Odoo 17 ERPHow to do quick user assign in kanban in Odoo 17 ERP
How to do quick user assign in kanban in Odoo 17 ERP
 
Barangay Council for the Protection of Children (BCPC) Orientation.pptx
Barangay Council for the Protection of Children (BCPC) Orientation.pptxBarangay Council for the Protection of Children (BCPC) Orientation.pptx
Barangay Council for the Protection of Children (BCPC) Orientation.pptx
 
Model Call Girl in Tilak Nagar Delhi reach out to us at 🔝9953056974🔝
Model Call Girl in Tilak Nagar Delhi reach out to us at 🔝9953056974🔝Model Call Girl in Tilak Nagar Delhi reach out to us at 🔝9953056974🔝
Model Call Girl in Tilak Nagar Delhi reach out to us at 🔝9953056974🔝
 

New microsoft office word document (2)

  • 1. /* Write a recursive function to obtain the first 25 numbers of a Fibonacci sequence. In a Fibonacci sequence the sum of two successive terms gives the third term. Following are the first few terms of the Fibonacci sequence: 1 1 2 3 5 8 13 21 34 55 89... */ #include<stdio.h> #include<conio.h> void main() { clrscr(); unsigned i,n=25,a=1,fib; for(i=0;i<n;i++) { printf("%u ",fib*a); a++; } getch(); } fib(unsigned n) { if(n==0) return 0; if(n==1) return 1; else return fib(n-1)+fib(n-2); } Out Put /* A 5-digit positive integer is entered through the keyboard, write a function to calculate sum of digits of the 5-digit number: (1) Without using recursion (2) Using recursion */ #include<stdio.h> #include<conio.h> void main() { clrscr(); long int n,s=0,b,sum; printf("Enter any 5-digit number: "); scanf("%ld",&n);
  • 2. printf("nnChoose : 1: sum of digits without recursivelynn"); printf("Or Choose : 2: sum of digits recursivelynnn"); printf("Your choice is = "); b=getche(); switch(b) { case '1': while(n!=0) { s=s+(n%10); n=n/10; } printf("nnnThe sum of digits is = %dn",s); break; case '2': s=sum+n; printf("nnnThe Sum of digits is = %dn",s); break; } getch(); } sum(long n) { static s=0; if(n==0) return s; else { s=s+n%10; n=sum(n/10); return n; } } Out Put