what is the output of the following program?
#include<stdio.h>
void main()
{
float x=1.1;
while(x==1.1)
{
printf("\n%f",x);
x=x-0.1;
}
}

Answer Posted / vignesh1988i

for the first time the loop will be true and it will print as 1.100000 , after reading the next line x will be 1.0, so again when it comes into while loop 1.000000 not equal to 1.100000 so it will come outside the loop

Is This Answer Correct ?    4 Yes 20 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

If jack lies on Mon, Tue Wed and jill lies on Thursday, Friday and Saturday. If both together tell they lied yesterday. So c the given options and then c cos in the given dates one will be saying the truth and one will be lying. I got Thursday as option because jack is saying the truth he lied yest but jill is lying again as he lies on that day.

1795


What are the advantages of using new operator as compared to the function malloc ()?

766


Explain what is a static function?

639


Linked lists -- can you tell me how to check whether a linked list is circular?

654


Explain high-order bytes.

687






What are the header files used in c language?

599


Are there namespaces in c?

578


What oops means?

596


Why is it important to memset a variable, immediately after allocating memory to it ?

1564


How do you determine whether to use a stream function or a low-level function?

668


How many bytes are occupied by near, far and huge pointers (dos)?

684


Write a program to maintain student’s record. Record should not be available to any unauthorized user. There are three (3) categories of users. Each user has its own type. It depends upon user’s type that which kind of operations user can perform. Their types and options are mentioned below: 1. Admin (Search Record [by Reg. No or Name], View All Records, Insert New Record, Modify Existing Record) 2. Super Admin (Search Record [by Reg. No or Name], View All Records, Insert New Record, Modify Existing Record, Delete Single Record) 3. Guest (Search Record [by Reg. No or Name], View All Records) When first time program runs, it asks to create accounts. Each user type has only 1 account (which means that there can be maximum 3 accounts). In account creation, following options are required: Login Name: <6-10 alphabets long, should be unique> Password: <6-10 alphabets long, should not display characters when user type> Confirm Password: Account Type: Login Name, Password and Account Type should be stored in a separate file in encrypted form. (Encryption means that actual information should be changed and Decryption means that Encrypted information is changed back to the actual information) If any of the above mentioned requirement(s) does not meet then point out mistake and ask user to specify information again. When Program is launched with already created accounts, it will ask for user name and password to authenticate. On successful authentication, give options according to the user’s type.

1523


What is spark map function?

589


5 Write an Algorithm to find the maximum and minimum items in a set of ‘n’ element.

1594


What is the difference between a function and a method in c?

573