please use this formet #include <iostream> using namespace std; int main(){ (1)
ID: 3641114 • Letter: P
Question
please use this formet#include <iostream>
using namespace std;
int main(){
(1) The largest factor of a number (the user supplies the number)
number = 24, Largest factor = 12
(2) An empty diamond of stars (the user supplies the height)
*
* *
* *
* *
* *
* *
*
(3) An X of stars (the user supplies the height)
* *
* *
* *
*
* *
* *
* *
(4) A pattern of 0's surround by *'s (the user supplies height and width)
*************
*0*0*0*0*0*
*************
*0*0*0*0*0*
*************
(5) A multiplication table (user supplies the size)
1 2 3 4 5 6
---------------------
1* 1 2 3 4 5 6
2* 2 4 6 8 10 12
3* 3 6 9 12 15 18
4* 4 8 12 16 20 24
(6) Sum of the digits of a number (user supplies the number)
number=245, sum of digits = 11
Explanation / Answer
1 #include using namespace std; int main() { int i,num,max=0; coutnum; for(i=1; i0;j–)/* space for the first time */ printf(” “); Printf (“*”);/* print the first ‘*’, */ For (j=0;jRelated Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.