Write a C++ statement that declares a variable student_id, and assigns a value 1
ID: 3772668 • Letter: W
Question
Write a C++ statement that declares a variable student_id, and assigns a value 1602 to it. Write the explosion below at a C++ statement (Assume all variables are declared.) h^201 /K + 2 Write an if... else statement that assigns 1 to z if x is greater than y, otherwise it assigns 20 to z. (Assume all variables are declared) Rewrite the if... else statement in pan c) using a conditional operator. Write C++ statements that declares a variable indata for file input and opens a text file named demo.Explanation / Answer
1. int studentid=1602; (we will use an integer value for student id)
2) float h,
float k;
float m,
m= ((h^201))/(k+2) ;
3. int x;
int y;
int z;
if(x>y)
z=1;
else
z=20;
4) using the conditional operator. z= (x>y) ? 1 : 20
5)
Related Questions
Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.