cs504 idea solution


Solution 1
#include <iostream>
using namespace std;
main()
{
char ch;
cout "Type a character in small letter [a-z] :";
cin >> ch;

switch(ch)
{
case 'l':
{
cout"You are a Lucky person";
break;
}
case 'a':
case 'z':
{
cout "You are an extremist (sorry to say)";
break;
}
case 'u':
{
cout"You are Unlucky, wish you good luck.";
break;
}
default:
{
cout"You are Unpredictable person";
break;
}
}
system("pause");
}



Solution 2
#include <iostream>
using namespace std;
void Fibonacci(int,int,int,int);
main()
{
unsigned int i=0,j=0,sum=1,num;

cout "Enter the limit for the series ";

cin >> num;
Fibonacci(num,i,j,sum);
system("pause");
}
void Fibonacci(int num,int i,int j,int sum)
{
cout sum endl;
i = j;
j = sum;
sum = i + j;

if (sum < num)
Fibonacci(num,i,j,sum);

}