منتديات الاحلام

عزيزي الزائر / عزيزتي الزائرة يرجي التكرم بتسجبل الدخول اذا كنت عضو معنا
او التسجيل ان لم تكن عضو وترغب في الانضمام الي اسرة المنتدي
سنتشرف بتسجيلك
شكرا
ادارة المنتدي

انضم إلى المنتدى ، فالأمر سريع وسهل

منتديات الاحلام

عزيزي الزائر / عزيزتي الزائرة يرجي التكرم بتسجبل الدخول اذا كنت عضو معنا
او التسجيل ان لم تكن عضو وترغب في الانضمام الي اسرة المنتدي
سنتشرف بتسجيلك
شكرا
ادارة المنتدي

منتديات الاحلام

هل تريد التفاعل مع هذه المساهمة؟ كل ما عليك هو إنشاء حساب جديد ببضع خطوات أو تسجيل الدخول للمتابعة.


    حل شيت البرمجه بلغه c

    mido
    mido
    المدير العام
    المدير العام


    عدد المساهمات : 7262

    حل شيت البرمجه بلغه c Empty حل شيت البرمجه بلغه c

    مُساهمة من طرف mido الجمعة 07 مايو 2010, 7:37 am

    حل شيت البرمجه بلغه c 98roqu

    حل شيت البرمجه بلغه c

    البرنامج الاول

    #include<stdio.h>
    #include<conio.h>
    void main(void)
    {
    float x,y,out;
    char z;
    printf("\t\t\twelcome to the calculator\n\n");
    printf("* enter the first number:");
    scanf("%f",&x);
    printf("\n");
    printf("* enter the second number:");
    scanf("%f",&y);
    printf("\n");
    printf("* click \n");
    printf("\t <a> for ADD \n");
    printf("\t <s> for SUBSTRACTE \n");
    printf("\t <d> for DIVIDE \n");
    printf("\t <m> for MULTIPLY \n");
    printf("\t enter your choice here: ");
    z=getche();

    if(z=='a')
    {
    out=x+y;
    printf("\n\n\t\t\t\t the result is : %5.6f\n\n",out);
    }
    else if(z=='s')
    {
    out=x-y;
    printf("\n\n\t\t\t\t the result is : %f\n\n",out);
    }
    else if(z=='d')
    {
    out=x*y;
    printf("\n\n\t\t\t\t the result is : %f\n\n",out);
    }
    else if(z=='m')
    {
    out=x/y;
    printf("\n\n\t\t\t\t the result is : %f\n\n",out);
    }
    printf("\t\t\t thanks for using the program\n\n");
    }


    ----------------------------------------------------------------------------------------

    البرنامج الثانى

    #include<stdio.h>
    void main(void)
    {
    char name[30];
    printf("\n");
    printf("enter your name:");
    scanf("%s",&name);
    printf(" welcome mr. %s",name);
    printf("\n");
    }

    ---------------------------------------------------------------------
    البرنامج الثالث
    #include<stdio.h>
    void main (void)
    {
    int i;
    for(i=1;i<=3;i++)
    printf("hello\n",i);
    }


    ------------------------------------------------------------------------
    البرنامج الرابع والاخير

    #include<stdio.h>
    #include<conio.h>
    void main (void)
    {
    int i;
    char name[30];
    do{
    printf("enter your name:");
    gets(name);
    printf("\n");
    printf("welcome mr. %s",name);
    printf("\n\n");
    printf("do you want to begin <y/n> :");
    }while(getche()!='y');
    printf("\n\n");
    printf("please enter your password :");
    scanf("%d",&i);
    printf("\n");
    if (i==123)
    printf("\t invalid password \n\n");
    }

      الوقت/التاريخ الآن هو الثلاثاء 14 مايو 2024, 1:20 pm