1. Write aprogram to find the largest number between two number using ternary operator. 
  2. Write aprogram, which take two values and print their sum.
  3. Program which take two values, and print their Multiplication.
  4. Write aprogram which take two values and print their sum of their square.
  5. Write aprogram which take three values and print Max. Value (using ternary operator).
  6. Write a program to convert kilogram into grams. 
  7. Write aprogram to convert inches into centimeters. 
  8. Write aprogram that accept basic salary of employee and compute the bonus @20 % ofbasic. Print Bonus and gross salary too. 
  9. Write a program which accept length  and breadth of a rectangle and print the Area and perimeter of it. 
  10.  Write aprogram which accept the arm of triangle and print the Area and perimeter of it.
  11. Write a program to read following numbers from yourkeyboards, round them to their nearest integer and print the result in integerformat. 37.7   50.123   -25.5649  -56.8877  123.0
  12. Write a Program that accept sale price and cost priceand find the profit and loss.
  13. Write a program to accept a four digit number and print the sum of first and last digit and product of mid digits.
  14. Write a program to accept the time in 24 hour formatand print message according to time like (good morning, good afternoon, goodevening, good night).
  15. Write a program to accept a number <10 print its inword eg. 1 to one , 2 to two.
  16. Write a program to accept a character and covert it upper case to lower case and lower to upper.
  17. Write a program to accept a character from user and process it like this. 
                  A) ifcharacter is alphabets then print next successive character e.g. a then b,   x then   y, x then a in C.   
                      B) if it is not alphabets then print thatcharacter as is…

Write a program to accept a character from user and process it like this. A) if character is alphabets then print next successive character e.g. a then b, x then y, x then a. B) if it is not alphabets then print that character as is…



#include<stdio.h>
#include<conio.h>
void main()
{
    char ch;
    printf("Enter the character = ");
    scanf("%c",&ch);
    ch=ch+1;
    printf("Successive character is = %c",ch);
getch();
}

OUTPUT :- 
 

Write a program to accept a character and covert it upper case to lower case and lower to upper in C.

#include<stdio.h>
#include<conio.h>
void main()
{
    char ch;
    printf("Enter the character = ");
    scanf("%c",&ch);
    if((ch>='a')&&ch<='z')
    {
        ch=ch-32;
        printf("Upper case is = %c",ch);
    }
    else
    {
        ch=ch+32;
        printf("Lower case is = %c",ch);
    }
getch();
}


OUTPUT :-

Write a program to accept a number 10 print its in word eg. 1 to one , 2 to two in C.

#include<conio.h>
#include<stdio.h>
void main()
{
  int n;
  printf("Enter the number b/w 0 to 10 = ");
  scanf("%d",&n);
  switch(n)
  {
    case 1 :
        printf("One");
        break;
    case 2 :
        printf("Two");
        break;
    case 3 :
        printf("Three");
        break;
    case 4 :
        printf("Four");
        break;
    case 5 :
        printf("Five");
        break;
    case 6 :
        printf("Six");
        break;
    case 7 :
        printf("Seven");
        break;
    case 8 :
        printf("Einght");
        break;
    case 9 :
        printf("Nine");
        break;
    case 10:
        printf("Ten");
        break;
  }
getch();
}

OUTPUT:-

Write a program to accept the time in 24 hour format and print message according to time like (good morning, good afternoon, good evening, good night) in C.

#include<stdio.h>
#include<conio.h>
void main()
{
  float time;
  printf("Enter the time = ");
  scanf("%f",&time);
  if(time<=12)
  {
    printf("Good Morning");
  }
  else if(time>12&&time<=18)
  {
     printf("Good Afternoon");
  }
  else if(time>18&&time<=22)
  {
    printf("Good evining");
  }
  else if(time>22&&time<=24)
  {
     printf("Good Night");
  }
getch();
}










OUTPUT :-
 

Write a program to accept a four digit number and print the sum of first and last digit and product of mid digits in C.



#include<conio.h>                        
#include<stdio.h>
void main()
{
  int n,a,b,c,d,e,f,g,sum,product; /* a,b,c,d,e,f,g are variable*/
  printf("Enter the four digit Number = ");
  scanf("%d",&n);
  a=n%10;//use for find out to modulas
  b=n/10;//usd for find out to division

  c=b%10;
  d=b/10;

  e=d%10;
  f=d/10;

  g=f%10;
  sum=a+g;
  product=c*e;
  printf("Sum of fist and last number = %d\n",sum);
  printf("Product of mid number = %d",product);
getch();
}


 OUTPUT :-




 

Write a Program that accept sale price and cost price and find the profit and loss.



#include<conio.h>                                                                                 
#include<stdio.h>
void main()
{
  float sale,cost,profit,loss; //Data type may be change as required
  printf("Enter the sale prize = ");
  scanf("%f",&sale);
  printf("Enter the cost prize = ");
  scanf("%f",&cost);
  profit=sale-cost;
  loss=cost-sale;
  if(profit>loss)
  {
    printf("Profit is = %f",profit);
  }
  else
  {
   printf("Loss is %f",loss);
  }
getch();
}
  
OUTPUT :-
 

Write a program to read following numbers from your keyboards in C, round them to their nearest integer and print the result in integer format. 37.7 50.123 -25.5649 -56.8877 123.0



#include<stdio.h>
#include<conio.h>
void main()
{
  float n;
  printf("Enter the float number = ");
  scanf("%f",&n);
  int a=(int)n;
  printf("Integer Number is = %d",a);
getch();
}

OUTPUT:-