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

Explain about the postpurchase interaction briefly, Explain about the postp...

Explain about the postpurchase interaction briefly. Postpurchase Interaction: Customer support and service: The considerations at such can be explained by the followin

What is a table cluster, What is a table cluster? A table cluster join...

What is a table cluster? A table cluster joins several logical tables in the ABAP/4 Dictionary.  Various logical rows from different cluster tables are brought together in a o

Determine how simulation can be developed, Determine how Simulation can be ...

Determine how Simulation can be developed To determine how a simulation can be developed for use in a real situation the below illustration has been chosen. Scenario chosen is

Functions in first-order logic sentences, Functions in first-order logic se...

Functions in first-order logic sentences - artificial intelligence: Functions may be thought of as special predicates, where we think of all but 1 of the arguments as input and

Array user interface, You were offered bonus marks for separating the user ...

You were offered bonus marks for separating the user interface code from the main logic of your program. This design choice makes it very easy to replace the user interface without

What is the protocol used by sap gateway process, What is the protocol used...

What is the protocol used by SAP Gateway process? The SAP Gateway method communicates with the clients based on the TCP/IP Protocol.

Indian standard code for information interchange, The ISCII is an 8-bit cod...

The ISCII is an 8-bit code which contains standard ASCII values till 127 from 128-225 it contains characters necessary in ten Brahmi-based Indian scripts. It is defined in IS 13194

Determine about the virtual private networks, Virtual Private Networks (VPN...

Virtual Private Networks (VPN) In order to encrypt/decrypt all the communication network traffic that passes through the Internet or Intranet, a VPN uses software or hardware.

Adder substractor, how can we bimpliment half substractor using nand gate

how can we bimpliment half substractor using nand gate

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