Welcome guest. Before posting on our computer help forum, you must register. Click here it's easy and free.

Author Topic: long long problem  (Read 3363 times)

0 Members and 1 Guest are viewing this topic.

michaeldadmum

  • Guest
long long problem
« on: November 10, 2007, 12:14:29 AM »
This program works in linux but not in windows:

#include<cstdio>
int main(){
 long long a=1234567;
 long long b=7654321;
 long long c=a*b;
 printf("%lld\n",c);
 return 0;
}


what's the problem?

dairyman

  • Guest
Re: long long problem
« Reply #1 on: November 28, 2007, 06:18:02 PM »
Instead of:

Code: [Select]
#include<cstdio>
Try:

Code: [Select]
#include <cstdio.h>
And I'm not sure if it will make any difference, but instead of:

Code: [Select]
int main(){
Try this instead:

Code: [Select]
int main()
{

Tripti



    Rookie

    Re: long long problem
    « Reply #2 on: November 29, 2007, 05:02:17 AM »
    hii,
    I think the following code works.
    worked for me, so you check out:

    #include<stdio.h>
    int main(){
    long long a=14354;
    long long b=5323;
    long long c=a*b;
    printf("%lld\n",c);
    getch();
    return 0;
    }

    I dont think there is any header file in c with the name "cstdio".
    Also if you want to view result you must add getch() to yuor program.

     :)

    JamesBond

    • Guest
    Re: long long problem
    « Reply #3 on: December 10, 2007, 09:33:34 AM »
    #include <cstdio>

    int main()
    {
     long long a=1234567;
     long long b=7654321;
     long long c=a*b;
     printf("%lld\n",c);
     
     getchar();
     return 0;
    }