How to take input from user

Duration: 8 min

This video lesson is available to enrolled students.

Return to /learn/HEXAWARE-PREPARATION/programming-basics-ccjavapython/programming-in-c/c-by-yash-sir/asset-how-to-take-input-from-user after enrolling

Inside: a video lesson and guided study material.

Module outline

  1. Quantitative Ability: Speed Mathematics and Basic Mathematics, Percentage, Ratio and Proportion (Ratios), Average, Profit and Loss, Simple Interest and Compound Interest, Time and Work, Pipe and Cistern, Speed Time and Distance, Number System, HCF LCM, Data Interpretation, Age Problems, Mixture and Alligation, Partnership, Algebra, Sequence and Series (Series), Mensuration and Geometry, Arithmetic
  2. Reasoning Ability: Puzzle Solving (Puzzles), Seating Arrangements, Coding Decoding, Blood Relations, Directions (Direction Test), Syllogisms, Data Sufficiency, Ranking, Order and Sequence, Series (Number and Letter Series) (Numerical Relations and Reasoning), Logical Sequence Of Words, Calendar, Clock, Cubes & Dices, Analytical Reasoning (Counting Figures Reasoning), Data Arrangement, Non Verbal Reasoning (Spatial Aptitude) (Spatial Reasoning) (Visual Reasoning), Deductive and Inductive Reasoning (Logical Deduction and Induction) (Prepositional Reasoning)
  3. Verbal Ability: Comprehension / Reading Comprehension / Unseen Passages (Critical Reasoning) (Paragraph Questions), Cloze Test (Cloze Passage), Sentence Re-arrangements (Para Jumbles) (Narrative Sequencing), Vocabulary, Sentence Completion (Fill in the blanks), Active Passive Voice (Voice), Direct and Indirect Speech, Subject Verb Agreement (Verb Noun Agreement), Tenses, Preposition, Articles, Sentence Correction (Error Correction)
  4. Programming Basics (MCQs + Interview): C Programming by Yash Sir, Programming in C++, Java, Python for Placements by Yash Sir
  5. OOPs (MCQs + Interview): Object Oriented Programming (OOPS)
  6. DBMS (MCQs + Interview): Basics of DBMS, ER Diagram, Relational Model & Functional Dependencies, Keys & Integrity Constraints, Normalization (1NF - BCNF), Transaction Management, Decomposition Properties & 4NF, Concurrency Control, Database Recovery, File Organization & Indexing, Relational Algebra, Database Security & Authorization
  7. SQL (MCQs + Interview): SQL
  8. Operating Systems (MCQs + Interview): Introduction to OS, Process Management, CPU Scheduling, Deadlock, Threads & Process Creation, Memory Management, Virtual Memory, Process Synchronization, Disc Scheduling, File Management, Security
  9. Computer Networks (MCQs + Interview): Introduction to CN, Data Communication, DLL: Access Control, DLL: Flow Control, DLL: Error Control, DLL: Framing, Data Link Layer - Ethernet, Net Layer: IPv4 & Proto, Net Layer: IP Addressing, Net Layer:Routing Protocol, Transport Layer Services, TL: Congestion & UDP, Application Layer, Hardware basics, Network Security, Mobile Technology, Cloud Computing and IoT, Cyber and Info Security
  10. Coding: Coding Questions by Yash Sir
  11. HR Interview: MR & HR Interview Preparation
AI summary & chapters

AI Summary

An AI-generated summary of this video lecture.

This educational video is a C++ programming tutorial that demonstrates how to write a program to calculate the square of a number. The instructor begins by showing a basic C++ program in an online IDE, which includes the necessary header files and the main function. The initial code uses a hardcoded value for the number, but the instructor then modifies it to accept user input using the cin statement. The program is executed with different inputs, such as 5 and 10, to show the output. The tutorial then transitions to a more advanced example, where the program calculates a number raised to a power, requiring the user to input both the base and the exponent. The instructor also shows how to use the pow() function from the math.h library to perform this calculation. The video includes a brief interlude where the instructor searches for the formula for the area of an equilateral triangle, which is presented as a visual aid. The overall teaching style is practical and hands-on, focusing on writing, modifying, and running code in real-time.

Chapters

  1. 0:00 – 2:00 00:00-02:00

    The video opens with a C++ code editor displaying a program to calculate the square of a number. The code includes the necessary headers #include <iostream> and using namespace std; and defines the main function. The instructor explains the structure of a C++ program. The initial code has a float variable x initialized to 5, and it prints the square of x. The instructor then modifies the code to prompt the user to enter a number, using cout to display "Enter Number:" and cin to read the input into the variable x. The output statement is updated to print the square of the entered number. The instructor runs the program, and the console output shows the result for the input 5, which is 25. The instructor also mentions that the program can be run with different values, such as 10, to get the square of 100.

  2. 2:00 – 5:00 02:00-05:00

    The instructor continues to demonstrate the C++ program for calculating the square of a number. The code is shown with the variable x initialized to 10, and the program is run to show the output of 100. The instructor then modifies the code to use the pow() function from the math.h library to calculate the square, which is shown as pow(x,2). The instructor explains that this method is more flexible for calculating powers other than 2. The video then transitions to a new topic, showing a Google search for the formula of the area of an equilateral triangle. The formula A = (√3/4) * a² is displayed, along with a diagram of the triangle. The instructor uses this as an example to illustrate how to apply the concept of calculating powers in a real-world scenario, such as calculating the area of a triangle with a given side length.

  3. 5:00 – 8:18 05:00-08:18

    The video returns to the C++ code editor, where the instructor demonstrates a more advanced program to calculate a number raised to a power. The code includes the necessary headers, including #include <math.h>. The program prompts the user to enter a number and a power, and then calculates the result using the pow() function. The instructor shows the code being written and executed, with the console output displaying the result of 5 raised to the power of 4, which is 625. The instructor explains that this method is more efficient than manually multiplying the number by itself multiple times. The video concludes with the instructor summarizing the key concepts covered, including how to take user input, perform calculations, and use the pow() function in C++.

The video provides a comprehensive, step-by-step tutorial on C++ programming, starting with the basics of writing a program to calculate the square of a number and progressing to more advanced concepts like user input and using the pow() function. The instructor uses a practical, hands-on approach, demonstrating code modifications and running the program to show the results. The inclusion of a real-world example, the area of an equilateral triangle, helps to contextualize the mathematical operations. The overall lesson emphasizes the importance of understanding the structure of a C++ program, how to interact with the user, and how to use built-in functions to perform complex calculations efficiently.

Loading lesson…