C++ Basic 2018 (Batch-2)
763 subscribers
277 photos
11 videos
30 files
74 links
๐ŸŽฏ C++ Basic 2018 (Batch 2) - Pre-Engineering Edition
My second family of coders! ๐Ÿ‘จโ€๐ŸŽ“๐Ÿ‘ฉโ€๐ŸŽ“
Specifically for 2018 pre-engineering students finding C++ challenging.
We turn confusion into clarity, one concept at a time.
Join the struggle bus - destination
Download Telegram
To register for the premium class of C++, ๐Ÿ‘‰ [@ProgrammingWithFaith_bot] ๐ŸŽ‰
โค2
Invite 5 friends and get 3 $TON ๐Ÿ’ฐ Instant withdraw ๐Ÿš€

Link ๐Ÿ”—
https://t.me/gramevents_bot?startapp=ref_53661
โค2๐Ÿ˜1
๐Ÿ“š Stressing over that assignment? Yeah, we get it.

Look, we've all been there deadlines creeping up, exams around the corner, and zero motivation to format another reference page. ๐Ÿ˜ฎโ€๐Ÿ’จ

So here's the deal: we'll take that assignment off your plate while you go crush your finals. ๐ŸŽฏ

โœจ What you get:

ยท โœ… Proper academic formatting that actually looks legit
ยท โœ… A clean, ready-to-submit document
ยท โœ… No stress, no all-nighters, no last-minute panic

๐Ÿ’ก The move is simple stop staring at a blank screen and start focusing on what's actually gonna boost your grades. Let us handle the busy work, you handle the big stuff. ๐Ÿง ๐Ÿ“–


๐Ÿ“ฒ DM @TechnerdGuy

@ProgrammingWithFaith2018
โค2
แˆตแ‰ตแˆ˜แ‹˜แŒˆแ‰ก 50000 BTTC แ‹ญแˆฐแŒฃแ‰นแˆƒแˆ แŠจแ‹› แ‰ แˆ˜แ‰€แŒ แˆ Sign In แ‹จแˆแ‰ตแˆˆแ‹ แ‹แˆตแŒฅ แŒˆแ‰ฅแ‰ณแ‰น 20000 BTTC แ‹ญแˆฐแŒฃแ‰นแˆƒแˆ แŠ แŒ แ‰ƒแˆ‹แ‹ญ แˆแŠ•แˆ แˆณแ‰ตแˆฐแˆฉ 70000 BTTC แ‹ญแˆฐแŒฃแ‰นแˆƒแˆ แŠจแ‹› Withdraw แˆ›แ‹ตแˆจแŒ แАแ‹ fam

๐Ÿ‘‡แˆˆแˆ˜แŒ€แˆ˜แˆญ๐Ÿ‘‡
https://bttcweb.com/pages/register/register?code=7574712
โค1
C++ Basic 2018 (Batch-2)
Final exam 2023_2.pdf
โœ…Answer  ๐Ÿ‘‡

PART I โ€” True or False

1. "If a condition is false, its statement executes and terminates the chain"
Explanation: When a condition is false, its body is skipped, not executed.
โœ… Answer: FALSE       

2. "A function cannot be defined inside another function"
Explanation: In C++, you strictly cannot write a function inside another function.  แ‰  C++ แ‹แˆตแŒฅ แŠ แŠ•แ‹ต function แ‹แˆตแŒฅ แˆŒแˆ‹ function แˆ˜แŒปแ แŠ แ‹ญแ‰ปแˆแˆแข แ‹ญแˆ… แ‹จ C++ แŒฅแ‰ฅแ‰… rule แАแ‹แข
โœ… Answer: TRUE


3. Does *ptr = 11 change i to 11?
Explanation: ptr holds the address of i. Using *ptr means go to that address and change the value โ†’ i becomes 11.                                                                                                 ptr แ‹จ i แŠ• address แ‹ญแ‹Ÿแˆแข *ptr = 11 แˆ›แˆˆแ‰ต "แ‹ˆแ‹ฐ address แˆ‚แ‹ต แŠฅแŠ“ valueแ‹แŠ• แ‰€แ‹ญแˆญ" แˆ›แˆˆแ‰ต แАแ‹ โ†’ i = 11 แ‹ญแˆ†แŠ“แˆแข
โœ… Answer: TRUE


4. Can both foo functions coexist?
Explanation: Yes โ€” this is function overloading. Same name, different parameters = allowed.
โœ… Answer: TRUE


5. Is strlen("Cletus") equal to 7?
Explanation: strlen() counts only the letters โ€” NOT the null character '\0'. "Cletus" = 6 letters โ†’ strlen = 6.
โœ… Answer: FALSE 

PART II โ€” Multiple Choice


Q1. Which array declaration is NOT correct?
Explanation: Arrays must be initialized with curly braces {}, not square brackets [].
โœ… Answer: C


Q2. Which is NOT true?
Explanation: Option B says "when condition is false, the if body executes" โ€” that is completely wrong. When false, the else body runs.
โœ… Answer: B


Q3. Statement for alternate paths based on condition?
Explanation: for and while are loops. The if statement is used for choosing alternate execution paths.
โœ… Answer: A


Q4. Which is TRUE about arrays?
Explanation: Array size must be decided at compile time โ€” you can't change it while the program runs.
โœ… Answer: C


Q6. Correct variable name?
Explanation: Variable names can only have letters, digits, and underscore _. $ and @ are not allowed in C++.
โœ… Answer: B


Q7. Output of str[5]?
Explanation: Counting from index 0: H(0) e(1) l(2) l(3) o(4) space(5) โ†’ space is at index 5.
โœ… Answer: C โ€” Space


Q8. Output of -2 * array[2]?
Explanation: array[2] = 40 (third element). Then -2 ร— 40 = -80.
โœ… Answer: C โ€” -80

Q9. Pointer program output?
Explanation: ptr = x assigns the value 7 as an address โ€” this is wrong. It should be ptr = &x. This causes a compiler error
โœ… Answer: C โ€” Error

Q10. Output of const program?
Explanation: const means the value cannot be changed. Trying a++ on a const variable causes a compiler error.
โœ… Answer: D โ€” Error

Q11. How many times is "CppBuzz.com" printed?
Explanation: i goes from 0 to 4 (when i=5, condition i<5 is false โ†’ no goto). So it prints 5 times.
โœ… Answer: B โ€” 5 times


Q12. Output of a++, b, c?
Explanation: b = a++ means b gets the current value of a (10) first, then a becomes 11. Then c = a โ†’ c = 11. Output: 11 10 11
โœ… Answer: A โ€” 111011

Q13. Variable declared inside a function?
Explanation: A variable declared inside a function only exists within that function โ€” called a local variable.
โœ… Answer: B โ€” Local variable

Q14. Output of car() program?
Explanation: car() is called once in main โ†’ prints "Audi R8" once.
โœ… Answer: A โ€” Audi R8

Q15. Output of fun(x, y)?
Explanation: fun uses pass by value โ€” it receives copies. Changing x and y inside fun does NOT affect the originals in main. So y stays 20.
โœ… Answer: B โ€” 20
                                                                                                                                                                                      PART III โ€” Short Answers

Q1. Declaration of x pointed to by Ptr:
Explanation: To declare a pointer to an integer variable:
int x;
int *Ptr = &x;
Q2. Pass by Value vs Pass by Reference:
Explanation :
Pass by Value -A copy is sent to the function and Original is NOT changed
Pass by Reference-The actual variable is sent using & and Original IS changed

@ProgrammingWithFaith2018
โค1๐Ÿ‘1