#includestdio.h
main()
{
printf
(
\%\d\
,
12
)
;
printf
(
\%\
d\
,
12
)
;
}
--
Regards,
SHUBHAM SANDEEP
IT 3rd yr.
NIT ALD.
--
You received this message because you are subscribed to the Google Groups
Algorithm Geeks group.
To post to this group, send email to
Hi..please repost your code after properly formatting ...it is not
readable...and throws compilation errors.
--
You received this message because you are subscribed to the Google Groups
Algorithm Geeks group.
To post to this group, send email to algogeeks@googlegroups.com.
To unsubscribe from
Chk is a macro that gets replaced with an if statement. The else part gets
attached to the most recent if which is the one from the macro. And since the
condition in macro fails, the else clause is executed.
--
Shuaib
http://twitter.com/ShuaibKhan
http://www.bytehood.com/
On 03-Oct-2011, at
@Shauib: cool soln. Thank you.
On Mon, Oct 3, 2011 at 6:14 PM, Shuaib aries.shu...@gmail.com wrote:
Chk is a macro that gets replaced with an if statement. The else part gets
attached to the most recent if which is the one from the macro. And since
the condition in macro fails, the else
+1
On Mon, Oct 3, 2011 at 6:40 PM, ~*~VICKY~*~ venkat.jun...@gmail.com wrote:
@Shauib: cool soln. Thank you.
On Mon, Oct 3, 2011 at 6:14 PM, Shuaib aries.shu...@gmail.com wrote:
Chk is a macro that gets replaced with an if statement. The else part gets
attached to the most recent if which
This will show syntax error due to x==9 and otherwise since memory address
given at the declarAtion there fore x value will. Change at every
assignment , but i m not sure printf will give an error or not . Plz reply.
On 17-Sep-2011 1:13 AM, Anshul AGARWAL anshul.agarwa...@gmail.com wrote:
x==9 is not an error...
it will be 1 when true and 0 when false...and both are executable
statements...
when we print float with %d then compiler prints 0...and when we print
integer with %f then compiler prints last assigned or printed float value to
any float variablehere it is assigned
x== 9 is not an error !!! it simply returns a non zero value if its true and
0 if its false
On Sat, Sep 17, 2011 at 11:39 AM, praveen raj praveen0...@gmail.com wrote:
This will show syntax error due to x==9 and otherwise since memory address
given at the declarAtion there fore x value will.
@yogesh :ya u right.
On Sat, Sep 17, 2011 at 11:58 AM, sukran dhawan sukrandha...@gmail.comwrote:
x== 9 is not an error !!! it simply returns a non zero value if its true
and 0 if its false
On Sat, Sep 17, 2011 at 11:39 AM, praveen raj praveen0...@gmail.comwrote:
This will show syntax
@yogesh : but if in place of x=1 in above code, I write t=54. that means i
m assigning somevalue to a float variable.Then it should print 54
afterwards.
but its again printing 98. how does it go with ur concept.
Ashima
M.Sc.(Tech)Information Systems
4th year
BITS Pilani
Rajasthan
On Fri, Sep
@Ashima..
u r right...it is always printing first float variable value
On Sat, Sep 17, 2011 at 2:05 PM, Ashima . ashima.b...@gmail.com wrote:
@yogesh : but if in place of x=1 in above code, I write t=54. that means i
m assigning somevalue to a float variable.Then it should print 54
#includestdio.h
int main()
{float t;
long x;
t=98;
printf(%d\n,t);
printf(%f\n,x);
{
x=1;
printf(%f\n,x);
{
x=30;
printf(%f\n,x);
}
printf(%f\n,x);
}
x==9;
printf(%f\n,x);
}
Printing a floating point with %d conversion specifier will not print the
expected resultss !
On Sat, Sep 17, 2011 at 1:13 AM, Anshul AGARWAL
anshul.agarwa...@gmail.comwrote:
#includestdio.h
int main()
{float t;
long x;
t=98;
printf(%d\n,t);
printf(%f\n,x);
{
i think this will be the only solution
--
You received this message because you are subscribed to the Google Groups
Algorithm Geeks group.
To post to this group, send email to algogeeks@googlegroups.com.
To unsubscribe from this group, send email to
algogeeks+unsubscr...@googlegroups.com.
For
Mike has $20 more than Todd. How much does each have given that
combined they have $21 between them. You can't use fractions in the
answer.
--
You received this message because you are subscribed to the Google Groups
Algorithm Geeks group.
To post to this group, send email to
well lets say its ruppees...
mike has Rs20.50 and Todd Rs .50 condition 1 satisfied
for condition 2. mike has 2050 paise and mike 50 paise...(P.S its not in
fractions)
I know u must be thinking im stupid bt i have read dis in sm book and dis is
wat the ans dey had gvn...:)
On Sun, Jul 31,
Describe an optimal algorithm to find the second minimum number in an
array of numbers. What is the exact number of comparisons required in
the worst case? Note that they didn't ask the order in Big-Oh
notation. They wanted the exact number of comparisons.
--
You received this message because
n+lgn-2 no of comparisions will do
On Thu, Jul 14, 2011 at 10:19 AM, shiv narayan narayan.shiv...@gmail.comwrote:
Describe an optimal algorithm to find the second minimum number in an
array of numbers. What is the exact number of comparisons required in
the worst case? Note that they didn't
use radix sort... and the answer is 0. ;)
On Thu, Jul 14, 2011 at 10:52 AM, sunny agrawal sunny816.i...@gmail.comwrote:
n+lgn-2 no of comparisions will do
On Thu, Jul 14, 2011 at 10:19 AM, shiv narayan
narayan.shiv...@gmail.comwrote:
Describe an optimal algorithm to find the second
char type is signed by default, so it represents value 255 as -1.
Code outputs first byte as unsigned int value, where -1 == 4294967295.
--
You received this message because you are subscribed to the Google Groups
Algorithm Geeks group.
To post to this group, send email to
# include stdio.h
#includeconio.h
#define concatinate(a,b) a##b
#define same1(a) #a
#define same2(a) same1(a)
int main(){
printf(%s\n,same2(concatinate(1,2)));
printf(%s\n,same1(concatinate(1,2)));
getch();
return 0;
}
Output is:
12
concatinate(1,2)
--
You received this message because you
2.
#includeiostream
using namespace std;
int main(){
int n = 255, i;
char *p = (char *)n;
for(i = 0; i sizeof(int); i++)
cout(unsigned int)p[i]\n;
cin.get();
return 0;
}
Output:
4294967295
0
0
0
I think p[0] is .So why it is giving 4294967295 in the first line.
--
You received this
check http://en.wikipedia.org/wiki/NaN
On Sat, Oct 9, 2010 at 6:15 PM, ankush jainankus...@gmail.com wrote:
#includestdio.h
void main()
{
int x;
float t;
scanf(%f,t);
printf(%f\n,t);
x=90;
printf(%f\n,x);
{
x=1;
How is the link you gave related to the output question here??
On Wed, Oct 13, 2010 at 7:20 PM, dinesh bansal bansal...@gmail.com wrote:
check http://en.wikipedia.org/wiki/NaN
On Sat, Oct 9, 2010 at 6:15 PM, ankush jainankus...@gmail.com wrote:
#includestdio.h
void main()
{
int x;
#includestdio.h
void main()
{
int x;
float t;
scanf(%f,t);
printf(%f\n,t);
x=90;
printf(%f\n,x);
{
x=1;
printf(%f\n,x);
{
x=30;
printf(%d\n,x);
hey! i am also unable to explain but one thing i got
if we use %d in place of %f,we will get the correct output.
we must use %d as x is of int data type.so thq code is itself
wrong.
or
u can change x to float data type
--
Ashutosh Tripathi
UG Student
Computer
26 matches
Mail list logo