Search found 4 matches

by abhishekbose87
Mon Dec 29, 2008 1:39 pm
Forum: C
Topic: 64 bit compiler (gcc) - expert question
Replies: 8
Views: 9580

Now I have got it !!

Thank u very much MF for clearing my doubt ...
by abhishekbose87
Sun Dec 28, 2008 3:44 pm
Forum: C
Topic: 64 bit compiler (gcc) - expert question
Replies: 8
Views: 9580

I still get a wrong answer ...


#include <stdio.h>
int main()
{
long long n=22214748323LL;
printf("%d\n",sizeof(int));
printf("%d\n",sizeof(long int));
printf("%d\n",sizeof(long long int));
n=n+1;
printf("%lld\n",n);
return 0;
}




I get the output -
4
4
8
-2080218972

while when I use the statement printf("%lu\n",n ...
by abhishekbose87
Thu Dec 25, 2008 7:40 pm
Forum: C
Topic: 64 bit compiler (gcc) - expert question
Replies: 8
Views: 9580

Re: Why I am getting compile error

I am using gcc 4.2.1 compiler(CodeBlocks IDE ) on windows platform . Why I am getting a compile error inspite of the fact that size of long long data type is 8 bytes .




#include <stdio.h>
int main()
{
printf("%d\n",sizeof(int));
printf("%d\n",sizeof(long int));
printf("%d\n",sizeof(long long ...
by abhishekbose87
Sun Dec 21, 2008 5:16 pm
Forum: Volume 100 (10000-10099)
Topic: 10035 - Primary Arithmetic
Replies: 328
Views: 102386

Re: 10035 - Primary Arithmetic

I cannot understand why I am getting WA ... Plz help me


#include<stdio.h>
long long int a ,b;
void convert(int *num,int *digits,long long int n)
{
int i;
*digits=0;
while(n>0)
{
num[*digits]=(int)(n%10);
n=n/10;
(*digits)++;
}
for(i=*digits;i<11;i++)
num[i]=0;
}
void find()
{
int ...

Go to advanced search