Search This Blog

Homework of Video 3 ( If-Else, While loop & Lots of Patterns (Part-1) ) - Love babbar


1. Why do we write namespace std & iostream as the program's header?

Ans. These are pre-built libraries where a code related to performing a certain task is placed So that, C++ can work effectively.

a. Using namespace std: There are a bunch of namespaces & out of them we are using std that makes the computer know that we are using cout. Basically, an identifier conflict resolver.

b. #include <iostream> : This header contains the programs of input & output functions like cout,cin etc. #include asks to include iostream


2. Guess the output :


Ans: NINEYPOSITIVE



Ans: 3


Ans: Love24

3. Write a code that accepts char ch. 

  • Prints this is the lowercase or small case if lies in between 'a' - 'z'
  • Prints this is uppercase  if lies in between 'A' - 'Z'
  • Prints this is numeric if lies in between '0' - '9'


4. Input N and print the sum of all the even numbers lying in 1 to N.



5.  Write a program to convert the temperature into:
  • Fahrenheit to celsius
  • Celsius to Fahrenheit

No comments:

Post a Comment