Answer:
Please find the answer below
Explanation:
// Online C compiler to run C program online
#include <stdio.h>
int main() {
// Write C code here
//printf("Hello world");
int userNum;
int i;
int j;
scanf("%d", &userNum);
/* Your solution goes here */
for(i = 0; i<=userNum; i++){
for(j = 0; j <= i; j++){
printf(" ");
}
printf("%d\n", i);
}
return 0;
}
User interface is the answer
Answer:
B. 1 6 3
Explanation:
Given function definition for calc:
void calc (int a, int& b)
{
int c;
c = a + 2;
a = a * 3;
b = c + a;
}
Function invocation:
x = 1;
y = 2;
z = 3;
calc(x, y);
cout << x << " " << y << " " << z << endl;
- Since x is passed by value, its value remains 1.
- y is passed by reference to the function calc(x,y);
Tracing the function execution:
c=3
a=3
b=c+a = 6;
But b actually corresponds to y. So y=6 after function call.
- Since z is not involved in function call, its value remain 3.
So output: 1 6 3
Usually it’s either 5400 or 7200RPM
Answer:
See explaination
Explanation:
#include <iostream>
using namespace std;
int main()
{
double h, w;
int s, a, b;
cout<<"height in feet: ";
cin>>h;
cout<<"width in feet: " ;
cin>>w;
cout<<"tile size in inches:";
cin>>s;
int height = h*12;
if(height%s==0)
a = height/s;
else
a = height/s + 1;
int width = w*12;
if(width%s==0)
b = width/s;
else
b = width/s + 1;
cout<<"Number of tiles: "<<a*b;
}