Showing posts with label Print. Show all posts
Showing posts with label Print. Show all posts

Wednesday, March 15, 2017

C++ Part 26

Void Functions

A void function performs some action, but does not return a value. For a void function, a function
invocation (function call) is a statement that can be used like any other C++ statement.

Example :

// void function example by NavidPlus.BlogSpot.com
#include <iostream>
using namespace std;

void printmessage ()
{
 cout << "This message is created by NavidPlus!";
}

int main ()
{
 printmessage ();
}



Sunday, March 12, 2017

C++ Part 15

Iteration

while: execute a statement as long as some condition is true

do while: similar to while but check condition after executing the statement.

for: execute a statement on every element of some data, or some fixed number of times.



while {loop body}

int count = 0 ;
while ( count < 3) { cout << ” Hello ” << count << endl ; count ++; }

Output :


Hello
Hello
Hello

Digital Design Part 3

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