Guys plz help in C++
plzzzzz. ...
Attachments:
Answers
Answered by
1
a)#include <iostream>
using namespace std;
int main()
{
int i;
for(i=15; i>=1; i--)
{
cout<<i<<"\t";
}
return 0;
}
b)#include <iostream>
using namespace std;
int main()
{
int i,n;
cout<<"Enter a number: ";
cin>>n;
for(i=1; i<=6; i++)
{
cout<<n<<"\t";
}
return 0;
}
c)#include <iostream>
using namespace std;
int main()
{
int i,n,m;
cout<<"Enter a number: ";
cin>>n;
for(i=1; i<=10; i++)
{
m = i*n;
cout<<m<<"\t";
}
return 0;
}
d)#include <iostream>
using namespace std;
int main()
{
int n,s;
n = 15;
s = n*(n+1)/2; //This is an equation to find the sum of n natural numbers.
cout<<s;
return 0;
}
Hope it helps :)
LegendaryQueen:
thanks a lot
Similar questions
Geography,
6 months ago
Social Sciences,
6 months ago
Physics,
6 months ago
Science,
1 year ago
Science,
1 year ago