Instructions: 1. Submission deadline6/1/20232. If you copy from others zero will be given. 3. Assignment should be written with neat handwriting on proper A4 papers. 4. Upload the handwritten assignment in the blackboard, and submit the written Assignment physically
Instructions: 1. Submission deadline6/1/20232. If you copy from others zero will be given. 3. Assignment should be written with neat handwriting on proper A4 papers. 4. Upload the handwritten assignment in the blackboard, and submit the written Assignment physically. Q1) Consider the following code: intn=10, m:m=2⋅(n+m)What is the values ofmandn? Answer: Q2) Determine the error and rewrite the correct code for the following function declaration; char Total(intx,y, intz) \{ ints=x+y+z; returns; Answer:
Q3) Exercise: Write a function that take your name and print a message say: Welcome, your name. Answer: Q4) Consider the following statements: struct studentName string first; string last; i; int main0 studentName st1, st2; Mark the following statements as valid or invalid. If a statement is invalid, explain why. a. st1.first="William"; b. st 1.last="Smith";
c. cin≫>st2; d. coutC++code to store the first component of products as follows: partName :printer, price : 150 c. Write aC++code to output the name of first part. Q5) To use a vector object in a program, which header file must be included in the program? Answer: Q6) What do the following statements do? u. vector aint > list(50);
b. vector namelist; Q7) Consider the following code:
Trending now
This is a popular solution!
Step by step
Solved in 2 steps