a=0;
while(a<5)
printf("%d\n",a++);
how many times does the loop occurs?
a.infinite
b.5
c.4
d.6
Answer Posted / bharath kumar
Hello,
The answer is b.
a=0+1=1
a=1+1=2
a=2+1=3
a=3+1=4
a=4+1=5
While a variable is storing the 5 result a is nither less
then are equal to 5 hence the application will come out of
the loop.So while loop had run 5 times.
| Is This Answer Correct ? | 28 Yes | 4 No |
Post New Answer View All Answers
What are the types of unary operators?
What is extern storage class in c?
When can you use a pointer with a function?
Write a program to implement a round robin scheduler and calculate the average waiting time.Arrival time, burst time, time quantum, and no. of processes should be the inputs.
How is a structure member accessed?
Do you know what are the properties of union in c?
What are reserved words?
Why we use stdio h in c?
which is conditional construct a) if statement b) switch statement c) while/for d) goto
Program will then find the largest of three numbers using nested if-else statements. User is prompted to enter three numbers. Program will find the largest number and display it on the screen. All three numbers entered by the user are also displayed. If user enters 21, 33, and 5, the output should be as follows: You entered: 21, 33 and 5. The largest number is 33.
Where local variables are stored in c?
What is c language used for?
Write a C program that will accept a hexadecimal number as input and then display a menu that will permit any of the following operations to be carried out: Display the hexadecimal equivalent of the one's complement. (b) Carry out a masking operation and then display the hexadecimal equivalent of the result. (c) Carry out a bit shifting operation and then display the hexadecimal equivalent of the result. (d) Exit. If the masking operation is selected, prompt the user lor the type of operation (bitwise and, bitwise exclusive or, or bitwise or) and then a (hexadecimal) value for the mask. If the bit shifting operation is selected. prompt the user for the type of shift (left or right), and then the number of bits. Test the program with several different (hexadecimal) input values of your own choice.
write a c program to find the largest and 2nd largest numbers from the given n numbers without using arrays
What is f'n in math?