Define the while loop, Computer Engineering

Assignment Help:

The while Loop

The while loop repeats a statement until the test at the top proves false. As an example, here is a function to return the length of a string.

int string_length(char string[])

{

int i = 0;

while (string[i] != '\0') I++;

return(i);

}

The string is passed to the function as an argument. The size of the array is not specified, the function will work for a string of any size. The while loop is used to look at the characters in the string one at a time until the null character is found. Then the loop is exited and the index of the null is returned. While the character isn't null, the index is incremented and the test is repeated.

 


Related Discussions:- Define the while loop

Scanning tips, Don't scan at more resolution than needed. This saves both D...

Don't scan at more resolution than needed. This saves both Disk and time Space. Typically itisn't useful to scan at more than optical resolution because it adds no new informa

Page translation table, Make a page translation table the meets the require...

Make a page translation table the meets the requirements of the virtual memory system given below.  Suppose page (and frame) sizes of 20 with pages 0 by 3 in logical memory and fra

Where do you set automatic correlation options, Automatic correlation from ...

Automatic correlation from web point of sight can be set in recording options and correlation tab. Here we can enable correlation for the whole script and choose either issue onlin

Explain top-down parsing, Explain Top down parsing. Top down parsing...

Explain Top down parsing. Top down parsing: Specified an input string, top down parsing tries to derive a string identical to this by successive application of grammar rule

Operation of micro controller, Consider the hardware design as shown. Withi...

Consider the hardware design as shown. Within the target system the EPROM would contain the hex data as shown below   Address  Assembly code   8000             86   8001

Differentiate between synchronous and asynchronous i/o, Differentiate betwe...

Differentiate between synchronous and asynchronous input/output with the help of an example. The input-output operation is asynchronous input/output operation since after the s

Explain the meaning of connect socket primitive, Explain the meaning of ...

Explain the meaning of CONNECT socket primitive. The connect Primitive: Clients utilize procedure connect to establish connection with an exact server. The form is

Write Your Message!

Captcha
Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd