need some help wid turbo c plzzz....

Discussion in 'C' started by infernoswethar, Jan 8, 2011.

  1. infernoswethar

    infernoswethar New Member

    Joined:
    Jan 8, 2011
    Messages:
    2
    Likes Received:
    0
    Trophy Points:
    0
    i want some help with these programs.... quick help is appreciated.. got my tests coming up next week!!:eek:hmy:

    pls read the question below-

    Q1. Write a program to get the number and print whether it is an odd or even number and also get a year and print whether it is a leap year or not.
    Q2. Write a program to get the number of days and print the number of months in the remaining days.
    Q3. Write a program to get three numbers using if statement and print the greatest number.
    Q4. Writ a programme to get 2 numbers and do the arithmetic operations like add, subtract ,multiply, divide, power, remainder based on the users choice and print the result..
    Q5. Write a program to find the area of various shapes like circle, triangle, rectangle, square according to the users choice.
    Q6. Write a program to find the sum of the series 1+5+9+13....+n, using for statement.
    Q7. Write a program to find the factorial of ‘n’.
     
  2. raji.vunnam

    raji.vunnam New Member

    Joined:
    Jan 6, 2011
    Messages:
    13
    Likes Received:
    0
    Trophy Points:
    0
    main()
    {
    int n,i;
    printf("enter year ");
    sacnf("%d",&n);
    i=n/100;
    if((i!=0 && n/4==0) || (i==0 && i/4==0)) /*leap year has two conditions
    printf("leap year ");
    else
    printf("not");
    }
    (1) devided by 4 with remindr as 0
    (2) if it is a century year(1500,1600,1700..............)then it should be devided by 400 with remindr as 0

    if year satisfies those two comds only consider as leap year
     
  3. raji.vunnam

    raji.vunnam New Member

    Joined:
    Jan 6, 2011
    Messages:
    13
    Likes Received:
    0
    Trophy Points:
    0
    main()
    {
    int n,i;
    printf("enter year ");
    sacnf("%d",&n);
    i=n/100;
    if((i!=0 && n/4==0) || (i==0 && i/4==0)) /*leap year has two conditions
    printf("leap year ");
    else
    printf("not");
    }
    (1) devided by 4 with remindr as 0
    (2) if it is a century year(1500,1600,1700..............)then it should be devided by 400 with remindr as 0

    if year satisfies those two comds only consider as leap year
     
  4. infernoswethar

    infernoswethar New Member

    Joined:
    Jan 8, 2011
    Messages:
    2
    Likes Received:
    0
    Trophy Points:
    0
  5. raji.vunnam

    raji.vunnam New Member

    Joined:
    Jan 6, 2011
    Messages:
    13
    Likes Received:
    0
    Trophy Points:
    0
  6. raji.vunnam

    raji.vunnam New Member

    Joined:
    Jan 6, 2011
    Messages:
    13
    Likes Received:
    0
    Trophy Points:
    0

Share This Page

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice