What is the output for the below program?
void main()
{
float me=1.1;
double you=1.1;
if(me==you)
printf("love c");
else
printf("know c");
}
Answers were Sorted based on User's Feedback
Answer / revathi pawar
know c is the answer because float and double r not same
the memory allocation differs so know c will b printed
| Is This Answer Correct ? | 10 Yes | 2 No |
Answer / anuradha
know c because do not compare float and double values
| Is This Answer Correct ? | 6 Yes | 0 No |
Answer / sangeetha
the answer for the above code will be know c because else
part is printed because float and double is not same
| Is This Answer Correct ? | 3 Yes | 0 No |
Answer / smartmove
Correction in last answer:
float me=1.1 it stores like 1.0999
double you=1.09999999
| Is This Answer Correct ? | 3 Yes | 0 No |
Answer / kalyan chukka
The Answer is Know c Because float having 7 digit numbers
and double having 15 digit number
float me=1.1 it stores like 0.99999
double you=1.099999999
so the Correct Answer is Know C
| Is This Answer Correct ? | 3 Yes | 1 No |
IS Doon college of Engn.. has good faculty
#include<stdio.h> #include<conio.h> void main() {clrscr(); char another='y'; int num; for(;another=='y';) { printf("Enter a number"); scanf("%d",&num); printf("squre of %d is %d",num,num*num); printf("\nwant to enter another number y/n"); scanf("%c",&another); } getch(); } the above code runs only one time.on entering 'y' the screen disappeares.what can i do?
Why is %d used in c?
IS it possible to define a zero sized array in c.if it is possible how can the elements of that array can be accessed.array index starts from zero,if it is possible to define zero sized array how can be its first element can be accesseed.
Is main is a keyword in c?
Linked lists -- can you tell me how to check whether a linked list is circular?
A function 'q' that accepts a pointer to a character as argument and returns a pointer to an array of integer can be declared as: A)int (*q(char*)) [] B)int *q(char*) [] C)int(*q)(char*) [] D)None of the Above
What is Heap?
Write a program that accepts a string where multiple spaces are given in between the words. Print the string ignoring the multiple spaces. Example: Input: “ We Are Student “ Output: "We Are Student"
what is function pointer?
What is int main () in c?
i want the code for printing the output as follows 4 4 3 3 2 2 1 1 0 1 1 2 2 3 3 4 4