SpareNet Servers Advertising & Link Exchange

اطلاعیه

بستن
هیچ اطلاعیه ای هنوز ایجاد نشده است .

سورس ماشین حساب در C

بستن
X
 
  • فیلتر
  • زمان
  • نمایش
پاک کردن همه
نوشته‌های جدید

  • سورس ماشین حساب در C

    کد:
    /* Calculator In C Language 
    By New Algorithm 
    + ************************************
    - ***********************************
    * ***********************************
    / ***********************************
    sin *********************************
    cos *********************************
    tan *********************************
    log *********************************
    sqrt ********************************
    fib *********************************
    fact ********************************
    WWW.IRANHACK.ORG 
    */
    #include <stdio.h>
    #include <math.h>
    int main() {
        system("title MS Dos Calculator"); // For Insert Caption For Page 
        int  a,b,c,d,r,i;
        int L1=1,L2=1,L3;
        int m = 1 ; 
        printf("--------------------------------------------------------------------------------\n");
        printf("MS Dos Calculator \n Help : \n + -> For Add A,B \n - -> For Lost A-b \n * -> For A*B \n \ -> For A\B \n s -> Sinos \n c -> Cosinos \n t -> Tangant \n l -> Logarithm \n q->sqrt \n f-> Factoriel \n i -> Get Fibonatchi Number \n w-> Clean Page \n e -> For Exit \n h -> Show Help \n............... \n Command Line: \n");
    
     
        while (( c=getchar()) !=EOF) {
              if (c=='+') { 
                        scanf("%d",&a);                 //For Add a,b
               scanf("%d",&b);
                     
                     
                printf("%d",a+b);
          printf("\n");
                }
                   if (c=='-') { //For Lost a-b
                      scanf("%d",&a);
                scanf("%d",&b);
                printf("%d",a-b);
                printf("\n");
                }
                   if (c=='*') { //For a*b
                      scanf("%d",&a);
                scanf("%d",&b);
                printf("%d",a*b);
                printf("\n");
                }
                   if (c=='/') { //For a / b 
                      scanf("%d",&a);
                scanf("%d",&b);
                printf("%d",a/b);
                printf("\n");
                }
                    if (c=='s') {
                scanf("%d",&a);
                printf("%f",sin(a)); // For Get Sinos(a)
                printf("\n");
                }
                      if (c=='c') {
                scanf("%d",&a);
                printf("%f",cos(a)); // For Get Cosinos(a)
                printf("\n");
                }
                      if (c=='t') {
                scanf("%d",&a);
                printf("%f",tan(a)); // For Get Tanjant(a)
                printf("\n");
                }
                         if (c=='l') { // For Get Logarithm(a)
                scanf("%d",&a);
                printf("%f",log(a));
                printf("\n");
                } 
                 if (c=='q') { //For Get SQRT(a)
                scanf("%d",&a);
                printf("%f",sqrt(a));
                printf("\n");
                }
                   if (c=='f') { //For Get Factoriel(a) Ex_:!5=120
                      scanf("%d",&a);
     for (i=1;i<=a;i=i+1)
    m=m*i;
    
    printf("%d",m);
    printf("\n");
                }
                   if (c=='w') { // For CLS Dos Page 
             
              system("cls");
                }
                   if (c=='h') { // For Show Help Text In Page
             
      printf("MS Dos Calculator \n Help : \n + -> For Add A,B \n - -> For Lost A-b \n * -> For A*B \n \ -> For A\B \n s -> Sinos \n c -> Cosinos \n t -> Tangant \n l -> Logarithm \n q->sqrt \n f-> Factoriel \n i -> Get Fibonatchi Number \n w-> Clean Page \n e -> For Exit \n h -> Show Help \n............... \n Command Line: \n");
                }
                if (c=='i') { // For Get Fibonatchi
                            scanf("%d",&a);
                                for (i=3; i<=a; i=i+1)  
        {
            L3 = L2+L1;
            L1 = L2;
            L2 = L3;
        printf(" %d",L3);
        printf("\n");
        }
    }
          
          if (c=='e') { // For Exit
             return 0;
              system("Exit");
                }
             
              }
    }
    انتشار با ذکر منبا مجاز می باشد WWW.IRANHACK.ORG [img]images/smilies/Smileys/8.gif[/img]
    وقتی باران می بارد همه ی پرندگان دنبال جان پناه هستند ...
    اما عقاب برای اینکه از باران در امان بمانـــد بالاتر از ابر ها پرواز می کنــــد ...

  • #2
    RE: سورس ماشین حساب در C

    دوست عزیزم از این به بعد سورس های خودتو اینجا در ادامه این تاپیک قرار بده :

    http://iranhack.com/acc/thread-1065.html

    با تشکر
    [align=center][/align]

    نظر

    صبر کنید ..
    X