Purchase Solution

Code analysis

Not what you're looking for?

Ask Custom Question

In the following code snippet, what value will be printed for c and d before the loop is executed? What value will be printed afterward? Why do you feel that this will occur? (Code needed to make this a complete program intentionally left out.)

int c = 99;
int a[5];
int d = 12;
printf("c = %dn",c);
printf("d = %dn",d);
while (c < 3)
{
printf("%dn",c);
c++;
}
a[5] = 0;
printf("c = %dn",c);
printf("d = %dn",d);
printf("Donen");
c = getchar();

Purchase this Solution

Solution Summary

The values which will be printed for c and d before the loop is executed are determined.

Solution Preview

Thias code snippet prints before the loop:
c = 99
d = 12

Thias code snippet prints after the loop:
c = 99
d = 12

And then it crashes.

a) The loop never executes, because ...

Purchase this Solution


Free BrainMass Quizzes
Java loops

This quiz checks your knowledge of for and while loops in Java. For and while loops are essential building blocks for all Java programs. Having a solid understanding of these constructs is critical for success in programming Java.

Javscript Basics

Quiz on basics of javascript programming language.

Basic Computer Terms

We use many basic terms like bit, pixel in our usual conversations about computers. Are we aware of what these mean? This little quiz is an attempt towards discovering that.

C# variables and classes

This quiz contains questions about C# classes and variables.

Excel Introductory Quiz

This quiz tests your knowledge of basics of MS-Excel.