Blogger templates

Searching...
Wednesday, March 20, 2013

Exclusive C

10:56 AM
This exclusive program is developed based on menu. There you will find total 18 options to choose a program. Just press a number according to your requirement. After taking an input from the keyboard you must press Enter every time. Hope that you will enjoy the program much. You may download the source code and execution file from here. Just click to start download



#include <stdio.h>
# define Kelv 273

int main()
{
    char let;
    int i, marks, age, x1, a3, b3;
    int series[100], n, c5, d5, shahid;
    double a, b, x, y, c, d, e, f, g, h, m, j, k, average;
    double a1, b1, c1, a2, b2, c2, u;
    char ch;
    double time, interest, asol_money, total_interest, total_money,
    monthly_iterest,year_1, daily_interest;

menu:
    system("cls");
    printf("***You are most welcome to Shahidujzaman Shahid's Exclusive programing world***\n");
    printf("There are eighteen programs. From 0 to 18 \n");
    printf("Which program would you like to run? \n \n");

    printf("\t1. Summation : Press 1 to run this program \n");
    printf("\t2. Subtraction : Press 2 for this program \n");
    printf("\t3. Multiplication : \n");
    printf("\t4. Division : Press 4 for this program \n");
    printf("\t5. Four in one : \n");
    printf("\t6. Choto der Namota : \n");
    printf("\t7. Math for shud - asol : \n");
    printf("\t8. B.Sc Result System : \n");
    printf("\t9. S.S.C and H.S.C Result System : \n");
    printf("\t0. Exit or Quit the program  : \n");
    printf("\t10. Solution of Equation : \n");
    printf("\t11. Solution of Equation : \n");
    printf("\t12. Average of ten numbers : \n");
    printf("\t13. Convert from celcious to kelvin : \n");
    printf("\t14. Convert from farenheit to celcious : \n");
    printf("\t15. Relations between two numbers : \n");
    printf("\t16. You are young or child : \n");
    printf("\t17. Choto theke borho >>> Bubble sorting : \n");
    printf("\t18. Conversion from decimal to hexadecimal: \n");


    do{
        printf("\nPlease, Select option from this menu to run a program : ");
        scanf("%d", &i);
    }
    while (i!= 1 && i!= 2 && i!= 3 && i!= 4 && i!= 5 && i!= 6 && i!= 7 && i != 8 && i!= 9 && i!= 0 && i!= 10 && i!= 11 && i!= 12 && i!= 13 && i!= 14 && i!= 15 && i!= 16 && i!= 17 && i!= 18 && i!=19);

    switch (i){

        case 1:

            printf("\nEnter a decimel or integer number (x): ");
            scanf("%lf", &a);
            printf("\nEnter a decimel or integer number (y): ");
            scanf("%lf", &b);
            printf("\nSummation of %0.2lf and %0.2lf is %0.2lf\n", a, b, a + b);
            printf("%0.2lf + %0.2lf = %0.2lf", a, b, a + b);
            printf("\n\nWould you like to view main menu? Press any key from keyboard.\n");
            getch();
            goto menu;

        case 2:

            printf("\nEnter a decimel or integer Number (a): ");
            scanf("%lf", &a);
            printf("\nEnter a decimel or integer Number (b): ");
            scanf("%lf", &b);
            printf("\nSubtraction of %0.2lf and %0.2lf [%0.2lf - %0.2lf] is = %0.2lf\n", a, b, a, b, a - b);
            printf("\n\nWould you like to enjoy again? Press any key from keyboard.\n");
            getch();
            goto menu;

        case 3:

            printf("\nEnter a decimel or integer Number (A): ");
            scanf("%lf", &a);
            printf("\nEnter a decimel or integer Number (B): ");
            scanf("%lf", &b);
            printf("\nMultiplication of this two numbers : \n\n%0.2lf X %0.2lf = %0.2lf", a, b, a * b);
            printf("\n\nPress any key if you want to continue all these programs. \n");
            getch();
            goto menu;

        case 4:

            printf("\nEnter a decimel or integer Number : ");
            scanf("%lf", &a);
            printf("\nEnter a decimel or integer Number : ");
            scanf("%lf", &b);
            printf("\nThe division of this two Numbers : \n\n%0.2lf / %0.2lf = %0.2lf", a, b, a / b);
            printf("\n\nWould you like to enjoy these programs again? \nPress any key from the keyboard... ");
            getch();
            goto menu;

        case 5:

            printf("\nEnter an integer number (x): ");
            scanf("%d", &marks);
            printf("Enter an integer number (y): ");
            scanf("%d", &x1);
            printf("\n%d + %d = %d\n", marks, x1, marks + x1);
            printf("%d - %d = %d\n", marks, x1, marks - x1);
            printf("%d x %d = %d\n", marks, x1, marks * x1);
            printf("%d / %d = %d\n", marks, x1, marks / x1);
            printf("\n\nWould you like to enjoy these programs again? \nPress any key from the keyboard... ");
            getch();
            goto menu;

        case 6:

            printf("\nEnter a number to know its multiplication with the first fifteen numbers: ");
            scanf("%lf", &a);
            for (b = 1; b<= 15; b++)
            {

                printf("\n%0.0lf X %0.0lf = %0.0lf\t", a, b, a * b);
            }
            printf("\n\nWould you like to enjoy these programs again? Press any key from keyboard.\n");
            getch();
            goto menu;

        case 7:

            printf("\nEnter the amount of main money : ");
            scanf("%lf", &asol_money);
            printf("Enter the rate of interest     : ");
            scanf("%lf", &interest);
            printf("Enter the amount of time       : ");
            scanf("%lf", &time);
            total_interest = (asol_money * interest * time) / 100;
            printf("\nAnswer (a): Shatkara %0.2lf tk har e %0.2lf takar \n%0.0lf year er interest (sud) = %0.2lf taka.\n",interest, asol_money, time, total_interest);total_money = asol_money + total_interest;
            printf("\nAnswer (b) : %0.0lf year pore sud-asol \nmiliye total money = %0.2lf tk.\n",time, total_money);
            year_1 = (asol_money * interest) / 100;
            printf("\nAnswer (c) : 1 Bochore interest (sud) : %0.2lf\n", year_1);
            monthly_iterest =  year_1 / 12;
            printf("\nAnswer (d) : Montly interest is %lf\n", monthly_iterest);
            daily_interest = monthly_iterest / 30;
            printf("\nAnswer (e) : Daily interest is %lf\n\n", daily_interest);
            printf("To view the main menu press any key...\n");
            getch();
            goto menu;

        case 8:

            printf("\nThe result is applicable for B.Sc Engineering and Honours. ");
            printf("\nThis program is designed by Md. Shahidujzaman Shahid. \nIt is used to calculate Letter Grade and Grade Point.");
            printf("\n\nPlease enter your marks in any subject: ");
            scanf("%d", &x1);
            if (x1 <= 39) {printf("\nSorry, you have failed in this subject. \n\nYour Letter grade is: F and \n\nYour Grade Point (GPA) is 0.00 ");
            }
            else if (x1 <= 44) {printf("\nYou have passed in this subject. \n\nYour Letter grade is D and \n\nYour Grade Point is 2.00 ");
            }
            else if (x1 <= 49) {printf("\nYou have passed in this subject. \n\nYour Letter grade is: C and \n\nYour Grade Point (GPA) is: 2.25 ");
            }
            else if (x1 <= 54) {printf("\nYou have passed in this subject. \n\nYour Letter grade is: C+ and \n\nYour Grade Point (GPA) is: 2.50 ");
            }
            else if (x1 <= 59) {printf("\nYou have passed in this subject. \n\nYour Letter grade is: B- and \n\nYour Grade Point (GPA) is: 2.75 ");
            }
            else if (x1 <= 64) {printf("\nYou have passed in this subject. \n\nYour Letter grade is: B and \n\nYour Grade Point (GPA) is: 3.00 ");
            }
            else if (x1 <= 69) {printf("\nYou have passed in this subject. \n\nYour Letter grade is: B+ and \n\nYour Grade Point (GPA) is: 3.25 ");
            }
            else if (x1 <= 74) {printf("\nYou have passed in this subject. \n\nYour Letter grade is: A- and \n\nYour Grade Point (GPA) is: 3.50 ");
            }
            else if (x1 <= 79) {printf("\nYou have passed in this subject. \n\nYour Letter grade is: A and \n\nYour Grade Point (GPA) is: 3.75 ");
            }
            else {printf("\nYou have passed in this subject. \n\nYour Letter grade is: A+ and \n\nYour Grade Point (GPA) is: 4.00 ");
            }
            printf("\n\nPress any key if you want to veiw and run all these programs again. \n");
            getch();
            goto menu;

        case 9:

            printf("\n\n          *** Welcome to Shahid's Personal software ***\n\n");
            printf("This program is used to find out Grade and \nGPA based on obtained marks in Examination");
            printf("\n\nPlease enter your marks in a subject: ");
            scanf("%d", &marks);
            if (marks <=32) {printf("\nYour Grade is F and GPA is 0\n");
            }
            else if (marks <=39) {printf("\n\nYour Grade is D and GPA is 1\n");
            }
            else if (marks <=49) {printf("\nYour Grade is C and GPA is 2\n");
            }
            else if (marks <=59) {printf("\nYour Grade is B and GPA is 3\n");
            }
            else if (marks <=69) {printf("\nYour Grade is A- and GPA is 3.5\n");
            }
            else if (marks <=79) {printf("\nYour Grade is A and GPA is 4 \n");

            }
            else {printf("\nYour Grade is A+ and GPA is 5\n");
            }
            printf("\n\nWould you like to view main menu? Press any key from keyboard.\n");
            getch();
            goto menu;

        case 0:

            printf("\n!!! Thanks to you for enjoying my exclusive programing !!! \n");
            printf("\nPress any key to Exit successfully from the software !!!\n");
            {
            break;
            getch();
            }

        case 10:

            printf("\nTwo equation is:\n \na1x + b1y = c1... ... ... (1) \na2x + b2y = c2... ... ... (2)");
            printf("\n \nEnter the co-efficient of the variables: \n \n");
            printf("a1 = ");
            scanf("%lf", &a1);
            printf("b1 = ");
            scanf("%lf", &b1);
            printf("c1 = ");
            scanf("%lf", &c1);
            printf("a2 = ");
            scanf("%lf", &a2);
            printf("b2 = ");
            scanf("%lf", &b2);
            printf("c2 = ");
            scanf("%lf", &c2);
            u = a1 * b2 - a2 * b1;
            x = (b2 * c1 - b1 * c2) / u;
            y = (a1 * c2 - a2 * c1) / u;
            if ((int) u == 0) {
            printf("\nThe solution of (x,y) isn't executable !\n");
            printf("It is called 'Math Error'.\n");
            }
            else {
            printf("\nx = %0.2lf  and \t", x);
            printf("y = %0.2lf\n\n", y);
            printf("(x, y) = (%0.2lf, %0.2lf)\n", x, y);
            }
            printf("\nTo view the main menu press any key from the keyboard  \n");
            getch();
            goto menu;

        case 11:

            printf("\nEnter the value of x + y: ");
            scanf("%lf", &a);
            printf("Enter the value of x - y: ");
            scanf("%lf", &b);
            x = (a + b) / 2;
            y = (a - b) / 2;
            printf("\nThe value of x is = %0.2lf\n", x);
            printf("The value of y is = %0.2lf\n", y);
            printf("\nTo view the main menu press any key from the keyboard  \n");
            getch();
            goto menu;

        case 12:

            printf("\nEnter a number (1): ");
            scanf("%lf", &x);
            printf("Enter a number (2): ");
            scanf("%lf", &y);
            printf("Enter a number (3): ");
            scanf("%lf", &c);
            printf("Enter a number (4): ");
            scanf("%lf", &d);
            printf("Enter a number (5): ");
            scanf("%lf", &e);
            printf("Enter a number (6): ");
            scanf("%lf", &f);
            printf("Enter a number (7): ");
            scanf("%lf", &g);
            printf("Enter a number (8): ");
            scanf("%lf", &h);
            printf("Enter a number (9): ");
            scanf("%lf", &m);
            printf("Enter a number (X): ");
            scanf("%lf", &j);

            average = (x + y + c + d + e + f + g + h + m + j) / 10;
            printf("\nThe average of the following\nten numbers is: %0.2lf\n", average);
            printf("\nPress any key to go to main menu\n");
            getch();
            goto menu;

        case 13:

            printf("\nEnter temparature in celcious: ");
            scanf("%lf", &c);
            k = c + Kelv;
            printf("\n%0.2lf degree celcious = %0.2lf kelvin \n", c, k);
            printf("\nTo view the main menu press any key...  ");
            getch();
            goto menu;

        case 14:

            printf("\nEnter temparature in Farenheit: ");
            scanf("%lf", &f);
            c = (5 * (f - 32)) / 9;
            printf("%0.2lf Farenheit = %0.2lf degree celcious.\n", f, c);
            printf("\nPress any key if you want to enjoy all these programs again. ");
            getch();
            goto menu;

        case 15:

            printf("\nEnter a number (a): ");
            scanf("%d", &a3);
            printf("Enter a number (b): ");
            scanf("%d", &b3);
            if (a3 == b3) {
                printf("\n%d is equal to %d", a3, b3);
            }
            if (a3 != b3) {
                printf("\n%d is not equal to %d", a3, b3);
            }
            if (a3 > b3) {
                printf("\n%d is greater than %d", a3, b3);
            }
            if (a3 < b3) {
                printf("\n%d is less than %d", a3, b3);
            }
            if (a3 >= b3) {
                printf("\n%d is greater than or equal to %d", a3, b3);
            }
            if (a3 <= b3) {
                printf("\n%d is less than or equal to %d", a3, b3);
            }
            printf("\nPress any key if you want to enjoy all these programs again. \n");
            getch();
            goto menu;

        case 16:

            printf("\nPlease enter your aeg: ");
            scanf("%d", &age);
            if (age <= 18) {
                printf("\nYou are stile a child...!!!\n");
        }
            else if (age <=30) {
                printf("\nYou are pretty young...!!!\n");
        }
            else if (age <=45) {
                printf("You are fitest...!!!\n");}
            else {
                printf("\nYou are very old...!!!\n");
        }
            printf("\nWould you like to enjoy these programs again? Press any key.\n");
            getch();
            goto menu;

        case 17:

            printf("\nHow many numbers are there in your sorting list...?? \n");
            printf("Enter the amount of number: ");
            scanf("%d", &n);

            printf("\nPlease Enter now %d integers: \n", n);
            for (c5 = 0; c5 < n; c5++)
            scanf("%d", &series[c5]);

            for (c5 = 0; c5 < (n - 1); c5++)
    {
            for (d5 = 0; d5 < (n -c5 - 1); d5++)
            {
            if ( series[d5] > series[d5+1] )
    {
            shahid = series[d5];
            series[d5] = series[d5+1];
            series[d5+1] = shahid;
    }
            }
    }

            printf("\n\nSo, the bubble sorting list is : \n \n");
            for (c5 = 0; c5 < n; c5++)
            printf("\t%d\n", series[c5]);
            printf("\nTo view the main menu press any key from the keyboard  \n");
            getch();
            goto menu;


    case 18:

        printf("\nEnter a number (decimal) : ");
        scanf("%d", &x1);
        printf("\nThe hexadecimal number of %d is %X", x1, x1);
        printf("\nTo view the main menu press any key from the keyboard  \n");
        getch();
        goto menu;

    case 19:


        printf("Press a letter: \n");
        //scanf("%c", &let);
        let = getch();

        if (let == 'a' || let == 'e' || let == 'i' || let == 'o'  || let == 'u'  || let == 'A' || let == 'U')
        {
            printf("It is a vowel");
        }
        else printf("It is a consonent.");
        break;

    }



    getch();
    return 0;
}

0 comments:

Post a Comment