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

C-programing, c-program for the minimum total number of shelves

c-program for the minimum total number of shelves

Generation of erp products, 1. How does this new generation of ERP products...

1. How does this new generation of ERP products differ from traditional solutions? 2. What are the major external forces driving competition in the ERP industry? Cloud comput

8086, the block diagram of an 8086 processor

the block diagram of an 8086 processor

What is keyboard layout, Q. What is Keyboard Layout? A keyboard layout ...

Q. What is Keyboard Layout? A keyboard layout is arrangement of keys across the keyboard. There is one keyboard layout which anybody who has worked on a standard keyboard or ty

Explain about aggregations, OLAP can process difficult queries and give the...

OLAP can process difficult queries and give the output in less than 0.1 seconds, for it to achieve like performance OLAP uses aggregations. Aggregations are built by aggregating an

System software, System Software System software is a group of progr...

System Software System software is a group of programs written to service another programs. Some system software (e.g., compilers editors and file management utilities) proc

Gather some ram data after system was powered off, (a) When a forensic exa...

(a) When a forensic examiner arrives at a crime scene, the first task done is referred to as "Incident Response". Summarize the different incident response tasks done in 10 steps.

Analysis of website, In this part you are required to review and critique a...

In this part you are required to review and critique a website of a café or a restaurant of your choice. Your report should be a minimum 500 words with a maximum of 1000 words. You

Define parallel programming, Conventionally software has been written for s...

Conventionally software has been written for serial computation in that programs are written for computers which have a single Central Processing Unit (CPU). Here the problems are

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