السلام عليكم ....
ممكن احد يشرح لي الاكواد هذي
#include<iostream>
using namespace std;
int main()
{
int n,r=0;
cout<<"Enter Positive value";
cin>>n;
int v=n;
while(v>0)
{
int rem=v%10;
v=v/10;
r=(r *10)+rem;
}
cout<<" the Revise of "<<n <<"="<< r;
return 0;
}
______________________________________________________________________________________________
#include<iostream>
using namespace std;
int main()
{
int value;
cout <<"Enter the value that specified for the table:";
cin>>value;
for (int i=1 ; i<= value ; i++)
{
for (int j=1 ; j<= i ; j++)
cout<<i*j<<" ";
cout<<endl;
}
return 0;
}
_____________________________________________________________________________________________________________
وشرح هذا السؤال
Question 5: Write a program that includes a function named print_pyramid (...) which takes a single
integer argument height and displays a pyramid of this height made up of of stars "*" characters on the
screen. The following output box shows an example:
This program prints a 'pyramid' shape of a
specified height on the screen
how high would you like the pyramid?: 50
Pick another height(must be between 1 and 10): -1
Pick another height(must be between 1 and 10): 6
*
***
*****
*******
*********
***********
وووشكرا