1. Very difficult to answer. Each language has its own features and advantages. One programming language might be better than the other depending on the context.
For example, C is better than any...
Type: Posts; User: Avenger625
1. Very difficult to answer. Each language has its own features and advantages. One programming language might be better than the other depending on the context.
For example, C is better than any...
int i=5,j;
j=++i + ++i + ++i;
printf("%d",j); //22
i=5;
j=i++ + i++ + i++;
printf("%d",j); //19
Shall not it give 21 and 18 respectively?????
Though C standard does not guarantee order of evaluation but its very logical to evaluate 2*n prior to --n. Most compilers does that. I personally have checked with 6 compilers.
For the sake of...
May be this what you want!!
int f(int n)
{
if(n==1) return 2;
return 2*n+f(--n);
}
Edit:
while (ch=getchar() != '\n');
Had a different while statement and then when it was changed I deleted the last part and the parenthesis but forgot to change it to
@ Matticus: The effort is really praiseworthy.
@ ulti-killer: U seem to be a beginner, perhaps the following code would be easier for u.
Code 1:
#include <stdio.h>
Had it been 5.3, the case comes out to be the same!!
Thanks!!!
>> >> scanf("%s",name);
But Java and maximum C++ compiler warns and require us to explicitly type cast it!!
Please re-explain!!!
Thanks...
#include <stdio.h>
int main(void)
{
int i=50/10.0;
//int i=50/10.0f;
return 0;
}
When it is possible to simulate OOP features into C then y dont we call it an OOP language?????
Polymorphism in C NOT in C++...!!!
I tried google but what all i found was C++ codes. Would you please take the trouble of explaining me things or post some good links?
You would need something like "%.20s"!!! But since this 20chars per line is not fixed every time and you can't use any variable (maxNoChars) in the formatting string you need to think otherwise....
Line 7: '&' missing. You perhaps overlooked it. Right one is, scanf("%c",&ques);
Me and my friends have had an argument over this topic.
Is it anyway possible to implement polymorphism in C?????
Thanks allooottt...!!! It really helped me....Thank you, all!!!
if(x>0.3) will not type promotion take place here??? x getting converted to double first and then compared.....????
If double represents floating-point nos. to a greater precession than float...
@Grumpy: "...a double represents it to greater precision than a float." -
If double represents it to a greater precession than float then x>0.3 i.e 0.3f>0.3 must be false.
@nonoob: Why does...
Thanks!! Got it....But just 2 queries....
1. 0.3f shows 0.300000 on my m/c so
if(x>0.3)
should be false and it shall print "NONE". But its not doing so....Why...?????
Thanks!! Got it....But just 2 queries....
Just an request: Please try in your machine before you reply.....
Why is it showing X????
#include<stdio.h>
int main(void)
{
@grumpy: I see. Thanks. It works fine now when min() is not called with size 0. But my question is - Why did Dev-Cpp work fine with that but not Pelles C x64?????
@grumpy:
Sorry I could not actually catch what or why is it for?! Could you please take the trouble of explaining it to me again.
@whiteflags: The program was run on -
1. Pelles C x64 on...