tgindex

C++ Basic 2018 (Batch-2)

описание

🎯 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

763
подписчиков

Лучшие посты

за три месяца
  • 13 июн.1 190 просмотров3 реакций10 пересылок

    5. Arrya is collection of elements with the same data types. To access first element of array we use Array[0] To access the last Array[n-1] But to access the memory address of first element just we call it's name for example int ages[]={1,3}; ages // to access the memory address of first element So ✅Answer :)D 6. Strcpy(a,b) copies the entire string from b to a So ✅Answer :) A

  • 13 июн.1 089 просмотров2 реакций8 пересылок

    3. To create 2D array the syntax is:) Datatypes array[row][column ] int array[10][5]; Answer :) C 4. Answer :) A

  • 20 июн.885 просмотров3 реакций

    ‎ How affirmative action work ? ‎ ‎Affirmative Action የሚሰጠው ለሴቶች ፣ከ አዳጊ ክልል ለመጡ እና ለ አካል ጉዳተኞች ነው። ‎ So ሴቶች 20% ‎ አዳጊ ክልል 5% ‎ አካል ጉዳተኞች 5% Free quota አላቸው ማለት ነው። ‎ ‎ለምሳሌ :-Software maximum in take capacity last year 80 students ነበር። ‎ ‎80%20 = 16 ,so 64 ተማሪ በ rank ነው ሚግባው የቀሩት 16 ተማሪ ደሞ free Quota ለሴቶች አለ። ‎ ‎ ‎ እንድ ሴት rankዎ 160 ቢሆን እና Software በ Affirmative መግባት ብፈልግ 64 በዋላ ያሎትን ሴቶች መቁጠር ነው , ለምሳሌ 1-160 rank ወስጥ 30 ሴቶች ቢኖሩ ፣ ከ እነዛ ዉስጥ ደም 15 ሴቶች 1-64 rank ዉስጥ ቢኖሩ የቀሩት 15 ሴቶች በ አላቸው rank compete ያደርጋሉ። ‎ ‎So 15 በ rank ስለ ገቡ የAffirmative Action Qouta አይዙም ። ‎ ‎ የቀሩት 10 ሴቶች ግን ለምሳሌ 100-160 ቢሆን በAffirmative Action Quota 15 ስለ ሆን 10 ዘና ብለወ ይግባሎ እንደሁም 5 free Quota ይኖራል ማለትም ከ160 በዋላ ያሉት 5 ሴቶች ከሙሉ ያለምንም Risk Soft ይግባሉ። ‎ ‎ ‎Mostly ተማሪ በአንደኛ የሚመርጠው Software ,CS,Elec ,Bio ,IT ነው ስለዚም 1-100 rank ያሉት ሁሉም Software ይመርጣሉ ሚለት አደለም እኔ Just Worst Case senario ወስጄ ሁሉም soft ቢገቡ ብዬ አስብ ነው 1-64 ወስጥ Elec,Cs,Bio ሚሙላ ስለ ሚኖሩ የምፈልጉት dep. የመግባት Chance ይኖሯቸዋል ማለት ነው። @ProgrammingWithFaith2018

  • 12 июн.783 просмотров1 пересылок

    Guys, it's 100% legit. 🫡 Here is the withdrawal proof. You can easily make money online, so I've included the link here. 💰 Register and sign in, and you will receive 70,000 BTTC. 🪙 Link : https://bttcweb.com/pages/register/register?code=7574712 🔗

  • 13 июн.762 просмотров4 реакций3 пересылок

    7. For loop that run from 5 to 105 in steps of 4 for (int i=5;i<=105;i+=4) ✅Answer:) A 8. Do while is different from while in the code in do while is executed at least once. ✅Answer:) B

  • 12 июн.756 просмотров2 реакций

    ስትመዘገቡ 50000 BTTC ይሰጣቹሃል ከዛ በመቀጠል Sign In የምትለው ውስጥ ገብታቹ 20000 BTTC ይሰጣቹሃል አጠቃላይ ምንም ሳትሰሩ 70000 BTTC ይሰጣቹሃል ከዛ Withdraw ማድረግ ነው fam 👇ለመጀመር👇 https://bttcweb.com/pages/register/register?code=7574712

  • 12 июн.678 просмотров1 реакций3 пересылок

    ስትመዘገቡ 50000 BTTC ይሰጣቹሃል ከዛ በመቀጠል Sign In የምትለው ውስጥ ገብታቹ 20000 BTTC ይሰጣቹሃል አጠቃላይ ምንም ሳትሰሩ 70000 BTTC ይሰጣቹሃል ከዛ Withdraw ማድረግ ነው fam 👇ለመጀመር👇 https://bttcweb.com/pages/register/register?code=7574712

  • 16 июн.636 просмотров3 реакций

    ካሁኑ viral ሳይወጣ ጀምሩ መጀመሪያ link ንኩት በመቀጠልም ወደ playstore ሲወሰዳችሁ app download ኣርጉት ልክ ሲከፍትላችሁ በ google account ክፈቱ ኣለቀ ✅በተረፈ ሰው ጋብዙ,video በማየትም ይከፍላል 1 invitatin - 1$$$$$ ግን ቶሎ ጀምሩ ያልገባችሁ ነገር ካለ ጠይቁኝ link👇 https://play.google.com/store/apps/details?id=com.app.cash.adda.playandwin 1000 coin =1$ ለመቀበል ከታች ያለውን Referral code copy አርጋችሁ ሙሉ 👇👇 M97b6xshpKQNOLUkbKwc2T1gxPw2 @examanswer1

  • 13 июн.634 просмотров7 реакций4 пересылок

    9. Break :) terminates execution immediately . ✅Answer D

  • 18 июн.626 просмотров6 реакций

    Should we continue like this? @ProgrammingWithFaith2018

  • 13 июн.582 просмотров3 реакций5 пересылок

    1. Function declaration malet just le compilerሁ sle function መንገር nw Syntax : datatypes functions_name(parameters ) Example int sum(int a,int b) with parameter int sum() without parameter So Answer:) D Because it lack return type 2. ANSWER:) A We define structure first then we create a variable @ProgrammingWithFaith2018

  • 12 июн.517 просмотров4 реакций4 пересылок

    void byValue(int x) { x = 100; } // original value አይቀይርም void byRef(int &x) { x = 100; } // original value ይቀይራል Q3. Function Overloading: Explanation: Multiple functions with the same name but different parameters. The compiler chooses the right one based on the arguments passed. አንድ ስም ያላቸው ግን የተለያዩ parameters ያላቸው functions። compiler የሚጠሩበትን arguments ተመርኩዞ ትክክለኛውን function ይመርጣል። int add(int a, int b) { return a + b; } // ሁለት int float add(float a, float b) { return a + b; } // ሁለት float // አንድ ስም ነው "add" - ግን parameters ይለያያሉ PART IV — Output Questions Q1. 2D Array output: Explanation: The loops run only for i=2, j=0 → that is val[2][0] = 1. ✅ Output: 1 Q2a. break version: Explanation: sum=+i means sum = +i (assign), not sum += i (add). When i=3, break fires immediately before assignment. i=5 → sum=5, i=4 → sum=4, i=3 → break! ✅ Output: 4 Q2b. continue version: Explanation: continue skips to the next iteration. sum+=i comes after continue so it never executes. Sum stays 0. ✅ Output: 0 Q3. String program: Explanation: strncpy(z, y, 9) copies first 9 characters of y into z. Then z[9]='\0' ends the string. ✅ Output: String y: It is a nice day String z: It is a n Q 4. Swap function: Explanation : A is pass by value (copy), B is pass by reference (real). So only b changes in main. A=4+18=22 (local), B=22-18=4 (b in main changes!), A=22-4=18 (local only) Back in main: a=4, b=4 ✅ Output: 4, 4 PART V — Programs Q1. Income Tax using namespace std; int main(){ float salary, tax = 0; cout << "Enter salary: "; cin >> salary; if(salary <= 200) tax = 0; else if(salary <= 600) tax = (salary - 200) * 0.10; else if(salary <= 1200) tax = 400*0.10 + (salary - 600)*0.15; else if(salary <= 2000) tax = 400*0.10 + 600*0.15 + (salary-1200)*0.20; else if(salary <= 3500) tax = 400*0.10 + 600*0.15 + 800*0.20 + (salary-2000)*0.25; else tax = 400*0.10 + 600*0.15 + 800*0.20 + 1500*0.25 + (salary-3500)*0.30; cout << "Income tax = " << tax << " Birr" << endl; return 0; } Q2. Count students below 45 using namespace std; int main(){ int n, mark, count = 0; cout << "Enter number of students: "; cin >> n; for(int i = 0; i < n; i++){ cout << "Enter mark for student " << i+1 << ": "; cin >> mark; if(mark < 45) count++; } cout << "Students below 45: " << count << endl; return 0; } Q3. Enter until negative using namespace std; void enterNumbers(){ int num; while(true){ cout << "Enter a number: "; cin >> num; if(num < 0){ cout << "Now you have entered a negative number" << endl; break; } } } int main(){ enterNumbers(); return 0; } @ProgrammingWithFaith2018

  • 12 июн.477 просмотров

    If anyone has last year's C++ final exam, please post it here in the comment section. 💻📝 @ProgrammingWithFaith2018 📲

  • 12 июн.388 просмотров2 реакций5 пересылок

    ✅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

  • 13 июн.376 просмотров2 реакций8 пересылок

    @ProgrammingWithFaith2018

  • 12 июн.332 просмотров1 реакций5 пересылок

    @ProgrammingWithFaith2018

  • 4 авг.204 просмотров4 пересылок

    Spider-Man: Brand New Day (2026) 1080p V3-HDTC Multi-LiNE [English + Hindi + Tamil +Telugu] ESub 🕸@filmbet28

  • 11 авг.117 просмотров

    https://youtu.be/iP88rT3gi0k?si=LB0W4y7vp1VTsamJ @ProgrammingWithFaith2018

  • 11 авг.113 просмотров1 реакций1 пересылок

    How is the grade given for the internship? 🎓 For IT, CS, and IS, it will count as one course, and the grade is based on how much you get. 📊 Ass1 represents the result from the company—it is worth 50% of the total grade. However, the company will give you a score out of 100%, which will then be divided by 2 to convert it to a score out of 50%. For example, if the company gives you 94 out of 100%, in Ass1 it will be divided: 94/2 = 47. Ass2 is evaluated by your advisor based on your report and is worth 25%. 📝 So far: 50 + 25 = 75. The remaining 25% is split into: ✅Quiz (5%) – they will ask you questions after your presentation. 🗣️ ✅Final Examination (20%) – your presentation and document will be evaluated while you present. 🎤 Example: If the company gives you 100 out of 100, your advisor gives you 24 out of 25, you get 4 on the quiz, and 17 on the final exam: ✅Ass1 = 50 ✅ Ass2 = 24 ✅ Quiz = 4 ✅Final Examination = 17 Total = 50 + 24 + 4 + 17 = 95 → which is an A+. @jucs_2015 #Cs #Internship

  • 12 июн.0 просмотров

    C++ Basic 2018 (Batch-2) pinned a photo