1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
Misha Larkins [42]
3 years ago
9

Construct an algorithm to print the first 20 numbers in the Fibonacci series (in mathematics) thanks

Computers and Technology
1 answer:
ss7ja [257]3 years ago
8 0

Answer:

0+1=1

1+1=2

1+2=3

2+3=5

3+5=8

5+8=13

Explanation:

// C++ program to print

// first n Fibonacci numbers

#include <bits/stdc++.h>

using namespace std;

 

// Function to print

// first n Fibonacci Numbers

void printFibonacciNumbers(int n)

{

   int f1 = 0, f2 = 1, i;

 

   if (n < 1)

       return;

   cout << f1 << " ";

   for (i = 1; i < n; i++) {

       cout << f2 << " ";

       int next = f1 + f2;

       f1 = f2;

       f2 = next;

   }

}

 

// Driver Code

int main()

{

   printFibonacciNumbers(7);

   return 0;

}

 

You might be interested in
Sara Beth and Taylor have developed a new software that they plan to distribute for free, allowing other software professionals
frosja888 [35]

Answer:

open source software

Explanation:

An open source software is any software that is released under an open source license, meaning that anybody can access its source code, see how it was made, and as the question says, "sutdy, change and improve it".

This is opposite to proprietary or closed source software where you can have a license to use the software but you can't see or change it's "building blocks" (i.e. code)

5 0
3 years ago
Question 4: What will be the output of the code? Show a complete analysis.
Eva8 [605]

Answer:

The output of the code is 8

4 0
3 years ago
write a program that prompts the user to input the length of a string as an integer, followed by the string and outputs the stri
dlinn [17]

OUTPUT of program :

Enter a string length: 5

Enter a string : hello

String in upper case letters is: HELLO

Enter a string length: 5

WRITE a Program that prompts the length of a string and the string in uppercase letters using dynamic arrays ?

#include <iostream>

#include <cstring>

#include <cctype>

using namespace std;

int main(){

char *str = new char[80];

int *num= new int[80];

char *str1=new char[80];

int len,i;

cout << "Enter a string: "

cin.get(str, 80);

cout << "Enter string length: "

cin.get(num, 80);

cout << "String in upper case letters is:"<< endl;

len = strlen(str);

for (i = 0; i <len; i++)

{

 *(str1+i)=toupper(*(str+i));

}

for(i=0;i<len;i++)

{

 cout<<*(str1+i);  

}

return 0;

}

C++ :

     

           Performance, effectiveness, and flexibility of usage were the design pillars of C++, which was created with systems programming, embedded, resource-constrained software, and big systems in mind. The software infrastructure and resource-constrained applications, such as desktop programmes, video games, servers, and performance-critical programmes, are two areas where C++ has been proven to be very useful.

                      Generic programming is made possible via C++ templates. Function, class, alias, and variable templates are supported in C++. Types, compile-time constants, and other templates can all be used to parameterize templates. At compile time, templates are implemented by instantiation. Compilers use particular inputs in place of a template's parameters to create a concrete instance of a class or function. Some substitutes are not possible, and an overload resolution policy with the motto "Substitution failure is not an error" eliminates these cases (SFINAE).                  

        C++ gives C features for object-oriented programming (OOP). It provides classes that offer the four features frequently found in OOP languages: polymorphism, inheritance, encapsulation, and abstraction. Support for deterministic destructors, which in turn provides support for the Resource Acquisition is Initialization (RAII) idea, sets C++ classes apart from classes in other programming languages.

       

To learn more about C++ refer :

brainly.com/question/13168905

#SPJ1

8 0
1 year ago
Read 2 more answers
What is one benefit of using electronic sticky notes ?
balu736 [363]
They can be used to just copy/paste e-mailed information without writing down on a paper and losing valuable time. This is one example.
4 0
3 years ago
Read 2 more answers
Identify the careers that require a college degree
Vikentia [17]
Doctor or teacher or an engineer

8 0
2 years ago
Other questions:
  • Dominick has been hired to design a network for Pirate Press. In a paragraph of no less than 125 words, discuss what he needs to
    12·2 answers
  • How can I sent a message?
    13·1 answer
  • . Why should we favor programming to interfaces over implementations?
    6·1 answer
  • In C++ please.
    8·1 answer
  • Adam is an Engineering student but has decided that he does not want to work in that field, but in the Manufacturing career clus
    11·2 answers
  • A good CRM should Integrate marketing, sales, and customer support activities measuring and evaluating the process of knowledge
    13·1 answer
  • Project introduction​
    14·1 answer
  • KDS Company has 3 departments: 1. Dept X 2. Dept Y 3. Dept Z. Design a program that will read as input each department's sales f
    6·1 answer
  • What is meant by reflection?​
    9·2 answers
  • At what layer in the TCP/IP protocol hierarchy could a firewall be placed to filter incoming traffic by means of:
    5·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!