|
Share Thread: Facebook Twitter Google+ |
|
LinkBack | Thread Tools | Search this Thread |
#1
|
||||
|
||||
Questions & Answer with Explanation
Simple question for uderstanding the concepts..
Q1: Main is Udf or Pre define Function ?? Q2: float a=0.7; if(a==0.7) cout<<"Hello " ; else cout<<"Bye"; whats the output ? |
#2
|
||||
|
||||
Quote:
2. Hello |
#3
|
||||
|
||||
ahan ..
1 . If it is Pre-define .. then why programmer write body of main ?? 2. did u tried it on compiler?? try it u will get correct answer :P
__________________
Believe me, the reward is not so great without the struggle. |
#4
|
||||
|
||||
sorry mate,
i dont have a compiler....but ll install and check it. i ll install eclipse CDT. but good questions How far have you prepared for CS yet? |
#5
|
||||
|
||||
i m not tring to attempt CSS because My English is not at that Level .. I've Done BSCS ..
__________________
Believe me, the reward is not so great without the struggle. |
#6
|
|||
|
|||
because for floating point numbers 0.7 does not really means 0.7 but it is 0.699999999 so it happens and if u want to make ur code work then write it like this
if (a==0.7f) //Note 'f' |
#7
|
||||
|
||||
Quote:
Float != Double .. that is the right explanation .. 0.7 is treated as Double by ur compiler so.. everthing is fine ..
__________________
Believe me, the reward is not so great without the struggle. |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Sentence | reman_bari1455 | English (Precis & Composition) | 1 | Tuesday, July 29, 2014 02:21 PM |
Post of AD(ISI) 2010: Preparation of MCQs Paper | redmax | Inter Services Intelligence (ISI) | 23 | Saturday, November 03, 2012 12:06 PM |
Gen. Knowledge MCQs | Rana G | General Knowledge, Quizzes, IQ Tests | 5 | Friday, May 22, 2009 10:38 PM |