Showing posts with label True. Show all posts
Showing posts with label True. Show all posts

Wednesday, March 15, 2017

C++ Part 24

Working with String - File - While Loop


//NavidPlus.blogspot.com
#include <iostream>
#include <fstream>
#include <string>
using namespace std;
int main( )
{
   string text;
  fstream inputStream;
   inputStream.open("Website");

   while (inputStream >> text)
{
cout << text << endl;
}

   inputStream.close();
   return 0;
}
// This Program will read all the input while the condition still true.

Input File : Webiste


NavidPlus https://NavidPlus.blogspot.com
NavidPlus@Blogger
Navid Plus is a Tech blog which is focusing on a Science material that I'll be learned every day through my College and job. Most likely blog's posts contain Programming, Security, Networking, Math, and photography. It is a FUN blog.
C Plus Plus @ NavidPlus
INTRO
Intro to C++ Part 1
Intro to C++ Part 2
Intro to C++ Part 3
Intro to C++ Part 4
Intro to C++ Part 5
Intro to C++ Part 6
Intro to C++ Part 7
Intro to C++ Part 8
_________________________________ C++ By NavidPlus.BlogSpot.Com

If you run this Program, you will find the problem !?

Sunday, March 12, 2017

C++ Part 13


Types of Control

  • Selection: Execute a different instruction depending on the result of evaluating some [Boolean] condition.
    • if/else, multiway if, switch, ? :
  • Iteration: Repetitively execute some instruction until some condition is met.
    •  for, while, do while.

Conditions

A condition is a Boolean expression - i.e., one that evaluates to true or false.
Most commonly either a relational operator or a logical combination of conditions:
Relational (Comparison) Operators:
== != < > <= >=
Logical operators:
! && ||
For example :  
  • n <= 100 && n >= 0  // n less than equal to AND n must be greater than 0
  • n< 101 && n >= 0  // n less than 101 AND n greater than equal to 0
  • grade> ’c’ && grade <= ’f’ // grade greater than 'c' ( character c ) AND less than equal to 'f'
  • y< x && y >= 0   // 

Digital Design Part 3

4th→ assembler translates it to the machine language. 1.6 [20] <§1.6> Consider two different implementations of the same instru...