How to take multiple input from user

Duration: 5 min

This video lesson is available to enrolled students.

Return to /learn/DELOITTE-NLA/technical-skills-coding/programming-in-c/c-by-yash-sir/asset-how-to-take-multiple-input-from-user after enrolling

Inside: a video lesson and guided study material.

Module outline

  1. Language Skills (English): Vocabulary Verbal Analogy (Word Based Analogy) Noun Pronoun Verb Adjectives Adverb Preposition Articles Conjunction Tenses Modals Subject Verb Agreement (Verb Noun Agreement) Determiner Active Passive Voice (Voice) Direct and Indirect Speech Sentence Correction (Error Correction) Sentence Completion (Fill in the blanks) Sentence Construction Sentence Re-arrangements (Para Jumbles) (Narrative Sequencing) Comprehension / Reading Comprehension / Unseen Passages (Critical Reasoning) (Paragraph Questions) Cloze Test (Cloze Passage)
  2. General Aptitude (Quantitative Ability): Percentage Ratio and Proportion (Ratios) Average Profit and Loss Simple Interest and Compound Interest Time and Work Pipe and Cistern Speed Time and Distance Mixture and Alligation Age Problems Partnership Number System HCF LCM Divisibility Rules Powers and Exponents (Surds and Indices) Algebra Data Interpretation Statistics Sequence and Series (Series) Logarithm Arithmetic
  3. General Aptitude (Reasoning Ability): Series (Number and Letter Series) (Numerical Relations and Reasoning) Coding Decoding Syllogisms Blood Relations Directions (Direction Test) Ranking, Order and Sequence Inequality Logical Sequence Of Words Seating Arrangements Puzzle Solving (Puzzles) Non Verbal Reasoning (Spatial Aptitude) (Spatial Reasoning) (Visual Reasoning) Cubes & Dices Venn Diagram Deductive and Inductive Reasoning (Logical Deduction and Induction) (Prepositional Reasoning) Selection Decision Table (Decision Making) Analytical Reasoning (Counting Figures Reasoning) Clock Calendar Data Sufficiency Analogy
  4. Technical Skills MCQ - Data Structure: Introduction to DS Array Stack Queue Linked List Tree Graphs Hashing
  5. Technical Skills MCQ - Networking: 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 Application Layer Network Security
  6. Technical Skills MCQ - Operating System: Introduction to OS Process Management CPU Scheduling Process Synchronization Deadlock Threads & Process Creation Memory Management Virtual Memory File Management Windows OS Linux OS Security Virtual Machines
  7. Technical Skills MCQ - DBMS: Basics of DBMS ER Diagram Relational Model & Functional Dependencies Keys & Integrity Constraints Normalization (1NF - BCNF) File Organization & Indexing Relational Algebra SQL Transaction Management Concurrency Control Database Recovery Database Security & Authorization NoSQL
  8. Technical Skills MCQ - Software Engineering: Fundamentals of Software Engineering Software Requirements and Quality Assurance Software Design, Estimation and Metrics Software Testing Software Maintenance and Configuration Management
  9. Technical Skills MCQ - Cloud Computing: Cloud Computing and IoT
  10. Technical Skills MCQ - Cyber Security: Cyber and Info Security Security in Mobile and Wireless Computing
  11. Technical Skills (Coding): Coding Questions by Yash Sir C Programming by Yash Sir Programming in C++ Java Python for Placements by Yash Sir Object Oriented Programming (OOPS) DSA by Prashant sir Coding Questions Bank
AI summary & chapters

AI Summary

An AI-generated summary of this video lecture.

This video is a C++ programming tutorial that demonstrates how to write a program to calculate the sum of two numbers. The instructor, Yash Jain, a coding expert, first presents a basic program that takes two integers as input from the user and outputs their sum. The code includes the necessary header files, uses the standard namespace, and defines the main function. The program prompts the user to enter two numbers, reads them using cin, and then prints the result using cout. The tutorial then transitions to a more advanced method, showing how to read two numbers separated by a space in a single input line. The instructor demonstrates this by modifying the code to use a single cin statement to read both numbers and then prints the sum. The video includes a live coding session with the program being compiled and executed, showing the input and output in a console window. The instructor explains the logic and syntax of the code, emphasizing the use of the iostream library and the cin and cout objects for input and output operations.

Chapters

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

    The video begins with a C++ code editor displaying a program to calculate the sum of two numbers. The code includes the necessary headers and uses the standard namespace. The main function is defined, and two integer variables, 'first_number' and 'second_number', are declared. The program prompts the user to enter the first number with 'cout<<"Enter First Number: ";' and reads the input with 'cin>>first_number;'. It then prompts for the second number and reads it. The sum is calculated and printed using 'cout<<"Sum of "<<first_number<<" and "<<second_number<<" is "<<first_number+second_number;'. The instructor, Yash Jain, is visible in a circular frame, explaining the code. The code is then executed, showing the input and output in a console window, with the program successfully calculating the sum of 10 and 20 as 30.

  2. 2:00 – 4:43 02:00-04:43

    The instructor modifies the code to demonstrate an alternative input method. The new code prompts the user to 'Enter Both Numbers followed by Space: ' and uses a single 'cin>>first_number>>second_number;' statement to read both numbers from a single line of input. The program then calculates and prints the sum. The instructor explains that this method is more efficient for reading multiple inputs on one line. The code is compiled and run, and the console shows the user entering '10 20', and the program correctly outputs 'Sum of 10 and 20 is 30'. The instructor also shows a test case with negative numbers, entering '-5 15', and the program correctly outputs 'Sum of -5 and 15 is 10'. The video concludes with the instructor summarizing the two methods for inputting multiple numbers in C++.

The video provides a clear, step-by-step tutorial on C++ input and output operations. It starts with a fundamental program that takes two numbers as separate inputs and calculates their sum, reinforcing basic syntax and the use of cin and cout. The instructor then builds upon this foundation by introducing a more efficient method for reading multiple inputs from a single line, demonstrating the versatility of the cin operator. This progression from a simple to a more advanced technique effectively teaches students how to handle different input formats in C++ programs, making it a practical lesson for beginners.

Loading lesson…