Professional Documents
Culture Documents
"WEEK#05"
"EXCERCISE: 1"
"PROGRAM":
#include<iostream>
int main () {
return 0;
"OUTPUT":
1000000000
"EXCERCISE:2"
#include<iostream>
int main () {
int n;
cin>>n;
if(i==0)
else
third=first+second;
first=second;
second=third;
cout<<third<<" ";
"OUTPUT"
Enter No 10
0, 1, 1, 2, 3, 5, 8, 13, 21, 34
"EXCERCISE:3"
Write a program by using any loop to find the sum of the first N
natural numbers,where the value of N is provided by the user
"PROGRAM"
#include<iostream>
int main () {
int N, i, sum=0;
cout<<"enter N"<<endl;
cin>>N;
sum=sum+i;
if(i<7)
cout<<i<<" + ";
else
cout<<i;
cout<<" = "<<sum;
return 0;
"OUTPUT"
Enter N: 7
1+2+3+4+5+6+7=28
"EXCERCISE:4"
1. Table number
"PROGRAM"
#include<iostream>
int main () {
return 0;
"OUTPUT"
Enter Table Numer 9
9 * 4 = 36
9 * 5 = 45
9 * 6 = 54
9 * 7 = 63
The end