Question
In c++: 1) Analyze the given programs and write the output. 1 Presents the correct output of the program clearly and concisely in an organized
In c++:
1) Analyze the given programs and write the output.
1 | Presents the correct output of the program clearly and concisely in an organized manner |
2 | Presents the output fairly clearly and concisely, and may have minor problems such as spacing |
3 | Presents the unclear output, and/or has significant organization problems such as spacing, spelling etc. |
4 | Presents half of the output with minor error such as spacing, spelling. |
int main() { int m[]= { 1, 2, 3, 4, 5,6,7,8,10 }; int n[10];
for(int i=0;i<10 ; i++) n[i]= m[i]+3; for( int i=10 ; i>=0 ; i--) cout<<(n[i]); }
Answer :
| int main() { int a[];
for(int k=0;k<10;k++) { a[k]= k * 3; } for( int i=10 ; i>=0 ; i--) cout<<(k[i]);
}
Answer :
|
2) Analyze the given programs and write the output.
1 | Presents the correct output of the program clearly and concisely in an organized manner |
2 | Presents the output fairly clearly and concisely, and may have minor problems such as spacing |
3 | Presents the unclear output, and/or has significant organization problems such as spacing, spelling etc. |
4 | Presents half of the output with minor error such as spacing, spelling. |
class rec
{ int len;
int wid;
public:
rec();
rec(int d);
rec( int b, int d);
void area()
{ int j;
j=len*wid ;
cout<<"the area is"< } }; rec::rec() { len=6; wid= 5; } rec:: rec(int y) { len=y; wid= 7; } rec:: rec(int y, int r) { len=y; wid= r; } int main() { rec e; rec p(5); rec f(10 ,2); p.area(); return 0; } Answer?
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started