Question about Computers & Internet

3 Answers

I need solve this type calulation is 0,1,1,2,3,5,8,13,21,34 etc. u send me the code of this type of calculation in c++ language

Posted by on

3 Answers

  • Level 2:

    An expert who has achieved level 2 by getting 100 points

    MVP:

    An expert that got 5 achievements.

    Novelist:

    An expert who has written 50 answers of more than 400 characters.

    Champion:

    An expert who has answered 200 questions.

  • Expert
  • 202 Answers

Hi,
 
I think you are one good student with interest in C++. I am reminded of my days in college. When my teacher asked me the same question, I wrote it in three formats. I am putting them all here. Wish you a very good learning time in the world of C/C++

Type 1:
********
#include<stdio.h>
void main()
{
int n;
int fibo(int,int,int);
printf("\nEnter number of terms in series:");
scanf("%d",&n);
fibo(n,0,1);
}
fibo(int n,int a,int b)
{
int c;
printf(" %d ",a);
c=b;
b+=a;
a=c;
if(n>0) fibo(n-1,a,b);
return 0;
}

Type 2:
********

#include<stdio.h>
void main()
{
int i,j,a=0,b=1,c;
printf("\nEnter number of terms in the series:");
scanf("%d",&i);
for(j=1;j<=i;j++)
 {
 printf(" %d ",a);
 c=b;
 b=a+b;
 a=c;
 }
}

Type 3:
********

#include<stdio.h>
void main()
{
int i,a=0,b=1,c;
printf("\nEnter number of terms in series:");
scanf("%d",&i);
while(i>0)
 {
 printf(" %d ",a);
 c=b;
 b=a+b;
 a=c;
 i--;
 }
}

**************************
Come back anytime for any program in basic C++. All my old codes wrote during my college days are lying without any use. :)

Have a nice day.

Posted on Nov 28, 2008

  • Chintu-KPV
    Chintu-KPV Nov 28, 2008

    Forgot to tell you one thing,

    The IO statements in my programs are all in 'C' level only. Use IOSTREAM class members for the same, if you want the program to look like a 'real' C++ one. :)

×

  • Level 2:

    An expert who has achieved level 2 by getting 100 points

    MVP:

    An expert that got 5 achievements.

    Novelist:

    An expert who has written 50 answers of more than 400 characters.

    Governor:

    An expert whose answer got voted for 20 times.

  • Expert
  • 150 Answers

Here is a Pascal stub
================

Program Fibonacci;

const
nmax = 500;

type
t_Farray = array [0 .. nmax-1] of LongInt ;

var
Farray : t_Farray;
i : word;

Begin
Farray [0] := 0; writeln(Farray [0]); // Initialize the ******
Farray [1] := 1; writeln(Farray [1]); //


for i:=2 to nmax-1 do begin
Farray[i] := Farray[i-2] + Farray[i-1];
Writeln (Farray[i]
end;


end.

Posted on Nov 13, 2008

  • Level 2:

    An expert who has achieved level 2 by getting 100 points

    MVP:

    An expert that got 5 achievements.

    Governor:

    An expert whose answer got voted for 20 times.

    Scholar:

    An expert who has written 20 answers of more than 400 characters.

  • Expert
  • 95 Answers

Ok! Here's a snippit from some code I wrote in beginning c++ classes. However, don't just cut and paste it. Know how it works since it's important in algorithm examination!

Just tested it, compiles and runs perfectly on GCC 4.0.1 on my mac, as well as my linux boxen. Windows may take some changes to output data.

/***********************************************
* Steven Parker
* Calculating Fib Sequence
* after two starting values, each number is the
* sum of the two preceding numbers
***********************************************/
#include <iostream>
using namespace std;

int main() {
int whentostop = 20; //How many values of sequence to calculate
int fib[whentostop]; //Hold fib numbers

for (int i=0; i < whentostop; i++) {
if (i == 0)
fib[0] = 0;
else if (i == 1)
fib[1] = 1;
else
fib[i] = fib[i-1] + fib[i-2];

cout << "Fibonacci[" << i << "]: " << fib[i] << endl;
}
return 0;
}

Posted on Nov 13, 2008

1 Suggested Answer

6ya6ya
  • 2 Answers

SOURCE: I have freestanding Series 8 dishwasher. Lately during the filling cycle water hammer is occurring. How can this be resolved

Hi,
a 6ya expert can help you resolve that issue over the phone in a minute or two.
best thing about this new service is that you are never placed on hold and get to talk to real repairmen in the US.
the service is completely free and covers almost anything you can think of (from cars to computers, handyman, and even drones).
click here to download the app (for users in the US for now) and get all the help you need.
goodluck!

Posted on Jan 02, 2017

Add Your Answer

Uploading: 0%

my-video-file.mp4

Complete. Click "Add" to insert your video. Add

×

Loading...
Loading...

Related Questions:

1 Answer

I need source code for create login page plz send


Hi,

Can u mention pls... which language(PHP,JAVA... etc) source code is you want.

Thanks and Regards
Trinoj

Aug 05, 2011 | Computers & Internet

1 Answer

What should i do when my Multi-Language is corrupted? do i need to format my laptop?


Dear Sarah,

You don't have to format your laptop ,

All you need to do is follow the below instructions :-

Go in control panel and then in regional and language options.

There you would find many options for languages and default language to be selected etc..

You can choose the language that you want , and your problem would be solved.

In case you have any further queries, feel free to get back to me , I would love to help you.

Jun 27, 2011 | Computers & Internet

1 Answer

I have lost my phone security code nokia 5200


Hello and Welcome to FixYa!

The Default
security code of Nokia is 12345 or 00000.
If you have changed then to get your Master code. Type *#06# at the mobile screen to know IMEI no of your mobile or you can also see the IMEI no after pulling out the battery, It is mention at back side of the mobile Then Go Here.
Give your IMEI No there and calculate your master code and try it.
It will work as your security code If it doesn't work too then you can get online paid security code for your cell. If you want to then you can Go Here.
After getting your Cell info and charges, they will send you code.
If you don't want to then you can contact to NOKIA SERVICE PROVIDER to solve your problem

Apr 26, 2011 | Computers & Internet

1 Answer

How can i unlock my nokia 1661-2 i forgot my security code


Hello and Welcome to FixYa!

The Default
security code of Nokia is 12345 or 00000.
If you have changed then to get your Master code. Type *#06# at the mobile screen to know IMEI no of your mobile or you can also see the IMEI no after pulling out the battery, It is mention at back side of the mobile Then Go Here.
Give your IMEI No there and calculate your master code and try it.
It will work as your security code If it doesn't work too then you can get online paid security code for your cell. If you want to then you can Go Here.
After getting your Cell info and charges, they will send you code.
If you don't want to then you can contact to NOKIA SERVICE PROVIDER to solve your problem

If you think this solution helps you then your token of appreciation in the form of Rating and a testimonial will be esteemed.
Thank you and Keep Visiting FixYa!

Apr 11, 2011 | Computers & Internet

1 Answer

I DONT KNOE THE LANGUAGE SETTING.PLS HELP ME.


HI, Change Language of Operating System there is 3 method:- 1) Install in English Instead of using initramfs for booting eeepc use this modified initramfs image:
http://www.roberto.foglietta.name/pub/xepc/en/initramfs.cpio.gz
This setup English localization only if the firstrun does not happen before and the localization would be written down into read-write partition. So this image is useful only during intallation.
2) Automatic Method locale_dialog can do this for you for English. Go to a terminal: Ctrl-Alt-T and type:
/opt/xandros/bin/locale_dialog
A simple dialog will open with a list of languages. Choose your desired language and press OK buttun (it's the button on the left). The system asks for reboot. Again press OK button (it's the burron on the left). Congratulations!
You may want to uninstall Taiwanese software,or programs, or languagepacks to save diskspace (tested on EeePc701). This does not uninstall the English versions or programs! Go here: http://wiki.eeeuser.com/howto:freespace
The above fails to revert all the dialog boxs to english in eee 701 etc - so see the last paragraph of this help page http://wiki.eeeuser.com/howto:configurefromscratch & change the firstrunwizard and remove the .firstrun file and reboot to an english version eee 701 etc.
3) Manual Method
  1. Start Eee PC
  2. Press Ctrl-Alt-T to open Terminal
  3. Type sudo /usr/bin/oowriter /etc/default/locale &
    (Another editor may be used to modify this file.)
  4. Change line to LANG=en_US.UTF-8
  5. Type sudo /usr/bin/oowriter /etc/locale.gen &
    (Another editor may be used to modify this file.)
  6. Remove the line zh_TW.UTF-8
  7. Type sudo dpkg-reconfigure locales and proceed
  8. press Ctrl-Alt-backspace or Reboot.
It is also possible to change to another language, e.g.
  • Change line to LANG=fr_FR.UTF-8 for French (doesn't work out of the box with these instructions)
  • Change line to LANG=en_GB.UTF-8 for English with UK keyboard-layout
  • Change line to LANG=it_IT.UTF-8 for Italian
  • Change line to LANG=de_GN.UTF-8 for German
  • Change line to LANG=zh_TW.UTF-8 for Traditional Chinese
  • Change line to LANG=zh_CN.UTF-8 for Sim Chinese
More information on language settings can be found in the i18n document.

i hope this will solve your problem.

goodluck

Jan 12, 2011 | Computers & Internet

2 Answers

The keyboard types thai. how to convert to english?


Hi vibhakawatra,

Your language settings have been set to Thai thats why the keyboard types Thai. However you can change it by following the steps below.
NOTE: The pictures shown below are in reference to Windows Vista. There will be little variations according to the Operating Systems.

1) Click Start and Select Control Panel.

arun_zac_4.jpg

2) Double click Regional and languages Options.

arun_zac_5.jpg

3) A window will pop up. In the window select the 'Keyboard and Languages Tab'.

arun_zac_6.jpg

4) Click on the 'Change Languages' button.

arun_zac_7.jpg

5) In the General Tab, Select the 'Add' Button to add languages.

6) Now, from the list of languages find and select 'English (US)' and click OK.

arun_zac_8.jpg

6) The current window closes and returns to the previous window. First click 'Apply' and then click 'OK'

7) Then again click 'OK'.

Your done. You might have to restart your computer for the changes to take effect.

Hope this solves your problem. If this information was helpful please rate this solution.

Thank you for using fixya.

Arun Zac

Nov 24, 2010 | Acer Computers & Internet

1 Answer

How to unblock facebook


i'm not sure what you mean.. unblock friends, album, or etc... Try you refer the link if there any something can solve your prob.. Use the language tab to change your language. How to change your setting (Facebook).

Aug 10, 2010 | Computers & Internet

1 Answer

My Keyboard works normally when I type a document or letter. However when I try to type an e-mail or letter, the keys do not always respond correctly.HELP appreciated bob.stinchcombe1@btinternet.com I am...


check the language bar. It's most likely changing from your default language to a secondary language. Set your prefered language to default and if that doesn't help, try to uninstall your secondary language.

If you still need your secondary language you then have to reinstall it but it most often solves problems like this.

Mar 15, 2010 | Microsoft Windows XP Home Edition

2 Answers

Need instructions on how to transfer a file from the PC to the Mainframe. Everything I have found leaves out a step or discribes it in developer language.


What type of mainframe are you referring to and what type of file do you want to transfer? How large is it, etc. Typically you would use ftp to transfer the file. If the mainframe is a IBM/Hitatchi type, you may need to convert the file to EBCEDIC. More likely, the mainframe is a type of Unix machine. It that case you probably want to send the file through ftp as ASCII. That should convert the line ending characters from CR/LF to LF. There are other transfer methods, but ftp is the easiest.

Sep 17, 2009 | Microsoft Windows XP Professional for PC

1 Answer

Ssssssssss


u will have to learn some language -vb, c, java,etc, ,,,,????

Jan 29, 2008 | Computers & Internet

Not finding what you are looking for?
Computers & Internet Logo

Related Topics:

157 people viewed this question

Ask a Question

Usually answered in minutes!

Top Computers & Internet Experts

Brian Sullivan
Brian Sullivan

Level 3 Expert

27725 Answers

kakima

Level 3 Expert

98879 Answers

David Payne
David Payne

Level 3 Expert

14089 Answers

Are you a Computer and Internet Expert? Answer questions, earn points and help others

Answer questions

Manuals & User Guides

Loading...