For every program, there should be a softcopy file containing (i) Algorithm/Flowchart, (ii)
Source Code, (iii) Output
Q.Write a program to find factorial of a given number k.
For every program, there should be a softcopy file containing (i) Algorithm/Flowchart, (ii)
Source Code, (iii) Output
Q.2.Write a program to display the first n terms of Fibonacci series.
For every program, there should be a softcopy file containing (i) Algorithm/Flowchart, (ii)
Source Code, (iii) Output
Q.1. Write a program to find squres and cubes of first n natural numbers.
write a program that create the following number patern.
1 2 3 4 5 6 7 8 9
1 2 3 4 5 6 7 8
1 2 3 4 5 6 7
1 2 3 4 5 6
1 2 3 4 5
1 2 3 4
1 2 3
If the originally x=2 ,y=1 and z=1, what are the value of x, y, z after executing the
following code?
Switch(x)
{
case 0 : x = 2;
y =3;
case 1 : x =4;
Default:
y = 3;
x = 1;
}
Re write the following code fragment using one switch statement
if (ch = = ‘E’|| ch= = ‘e’)
cout<<" this is either the value of ‘E’ or ‘e’";
else if (ch = = ‘A’|| ch= = ‘a’)
cout<<" this is either the value of ‘A’ or ‘a’";
else if (ch = = ‘r’|| ch= = ‘i’)
cout<<" this is either the value of ‘i’ or ‘r’";
else
cout<<" Enter the correct choice";
Write a C++ program for the following flowchart. N.B Let the user enter the
initial value of X and Y, finaly your program should return the value of X, Y and
Z.
Class A {
public void test ( ) {
The Fibonacci sequence is constructed by adding the last two numbers of the sequence so far to get the next number in the sequence. The first and the second numbers of the sequence are defined as 0 and 1. We get:
0, 1, 1, 2, 3, 5, 8, 13, 21…
Write a function which takes input as a number:
int getFibOutput(int input) {
// TODO:
}
Example
(21 is a Fibonacci number)
Input: 21 Output: 21
(20 is NOT a Fibonacci number so, output is 10 (13+8+5+3+2+1+1))
Input: 20 Output: 33
1. What do you think will motivate the intended audience to participate in the website?
2.what are the possible effects of the website on the product and service providers in the community?
3. What are the possible effects of the website on the consumers in the community?
4. If so how do you incorporate these points in the design and content of your website?