Skip to content
0

1) Write a C program to accept a coordinate point in a XY coordinate system and determine in which quadrant the coordinate point lies.

2) Write a C program to play a Rock, Paper and Scissor game between user and the computer.

3) Write a program in C to read any day number in integer and display day name in the word.

4) Write a program in C to read any Month Number in integer and display the number of days for this month.

5) Write a C program to find the eligibility of admission for a professional course based on the following criteria:
Marks in Maths >=65
Marks in Phy >=55
Marks in Chem>=50
Total in all three subject >=180
or
Total in Math and Subjects >=140

6) Write a C program to check whether a triangle is Equilateral, Isosceles or Scalene. Take the angles as user input.

7) Write a program in C to calculate and print the Electricity bill of a given customer. The customer id., name and unit consumed by the user should be taken from the keyboard and display the total amount to pay to the customer. The charge are as follow :

Unit Charge/unit
upto 199 @1.20
200 and above but less than 400 @1.50
400 and above but less than 600 @1.80
600 and above @2.00

 

3 thoughts on “Program SET 1”

  1. Angel D'costa

    Angel D’costa FYCS F073

    Q.03) Write a program in C to read any day number in integer and display day name in word.

    Code:

    #include <stdio.h>
    void main()
    {
    int n;
    clrscr();
    printf(“Enter number corresponding with day: “);
    scanf(“%d”, &n);
    if (n<=7)
    {
    if (n==1)
    printf("Monday");
    else if (n==2)
    printf("Tuesday");
    else if (n==3)
    printf("Wednesday");
    else if (n==4)
    printf("Thursday");
    else if (n==5)
    print("Friday");
    else if (n==6)
    printf("Saturday");
    else if (n==7)
    printf("Sunday");
    }
    else
    printf("Number doesn't correspond with any day\n");
    getch();
    }

    Output:
    Enter number corresponding with day: 3
    Wednesday

  2. Shreyas Acharya

    C Programming
    Shreyas Acharya FYCS F071

    Q1) Write a c program to accept a coordinate point in a XY coordinate system and determine in which quadrant the coordinate point lies.

    Code:-
    /*C program to accept a coordinate point in a XY coordinate system and determine its quadrant*/

    #include
    {
    int x,y;
    clrscr();
    printf(“Enter the value for X and Y: \n”);
    scanf((“%d %d”,&x,&y);
    if(x > 0 && y > 0)
    printf(“point (%d, %d) lies in the First quadrant\n”);
    else if (x 0)
    printf(“point (%d, %d) lies in the Second quadrant\n”);
    else if (x < 0 && y 0 && y < 0)
    printf("point (%d, %d) lies in the Fourth quadrant\n");
    else if (x == 0 && y == 0)
    printf("point (%d, %d) lies in the origin\n");
    getch();
    }

    Output:
    Enter the value for X and Y :
    2 3
    point (3, 2) lies in the First quadrant.

  3. Shreyas Acharya

    C Programming
    Shreyas Acharya FYCS F071

    Q1) Write a c program to accept a coordinate point in XY coordinate system and determine in which quadrant the coordinate point lies.

    Code:
    #include

    int main()
    {
    int a,b;
    clrscr();
    printf(“Enter the coordinates: “);
    scanf(“%d %d,&a,&b);
    if(a>0 && b>0)
    {
    printf(“\n FIrst Quadrant”);
    }
    else if (a0)
    {
    printf(“Second Quadrant”);
    }
    else if (a<0 && b0 && b<0)
    {
    printf("Fourth Quadrant");
    }
    else
    printf("Origin")
    getch();
    }

    Output:
    Enter the Coordinates:
    2 3
    First Quadrant.

Leave a Reply

Your email address will not be published. Required fields are marked *

error: Content is protected !!