salmancreation

C Programing - DIU 4th Simister Java Class 01 Problem

Jan 18th, 2016
83
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 2.35 KB | None | 0 0
  1. One No Problem:
  2. #include <stdio.h>
  3. main()
  4. {
  5.     int a,b,c,big;
  6.     scanf("%d%d%d",&a,&b,&c);
  7.     if (a> b && a>c){
  8.         printf("A is The Larger Number Of Them = %d",a);
  9.     }
  10.     else if(b>a && b>c){
  11.         printf(" B is The Larger Number Of Tem = %d",b);
  12.     }
  13.     else if(c>a && c>b){
  14.         printf("C is The Larger Number Of Them = %d ",c);
  15.     }
  16.     return 0;
  17. }
  18.  
  19.  
  20. Two No Problem :
  21.  
  22. #include<stdio.h>
  23. main(){
  24.     int a,b;
  25.     int sum;
  26.     printf("Type Your Two Digit For Sum, Thank You \n");
  27.  
  28.     scanf("%d%d",&a,&b);
  29.     printf("Your Two Digit Are %d & %d \n",a,b);
  30.     printf("What You Want To Do . \n 1. Addition + \n 2. Subtrack - \n 3. Multiply * \n 4. Divide  / \n Enter Your Operator Number For Them and Enjoy \n ");
  31.     scanf("%d",&sum);
  32.     switch(sum){
  33.         case 1 :
  34.         printf(" Addition Of The Two Number is %d \n",a+b);
  35.         break;
  36.  
  37.          case 2 :
  38.         printf(" Subtrack Of The Two Number is %d \n",a-b);
  39.         break;
  40.  
  41.          case 3 :
  42.         printf(" Multiply Of The Two Number is %d \n",a*b);
  43.         break;
  44.  
  45.         case 4 :
  46.         printf(" Divide Of The Two Number is %d \n",a/b);
  47.         break;
  48.  
  49.     }
  50.  
  51. return 0;
  52. }
  53.  
  54.  
  55. Three No Problem :
  56.  
  57. #include<stdio.h>
  58. main(){
  59.     char letter;
  60.     printf("Enter Your Character Letter \n");
  61.     scanf("%c",&letter);
  62.     printf("Your Character is = %c \n",letter);
  63.  
  64.     if (letter >= 'A' && letter<='Z'){
  65.         printf("Your Character Is Capital Letter \n");
  66.     }
  67.     else{
  68.         printf("Your Character Small Letter \n");
  69.     }
  70.  
  71. return 0 ;
  72. }
  73.  
  74.  
  75. Four No Problem:
  76. #include<stdio.h>
  77. #include<conio.h>
  78. main(){
  79.     float radius,circal,p;
  80.     float r = 3.1416;
  81.     printf("Enter Your Radius Circal Area \n");
  82.     scanf("%f",&radius);
  83.     circal = r*(radius*radius);
  84.     p = 2*r*radius;
  85.     printf("Your Radius Circal Area Is = %.4f \n",circal);
  86.  
  87.     printf("\nYour Primitter Area Is = %.4f \n",p);
  88.  
  89.      int length, breadth, area;
  90.    printf("\nEnter the Length of Rectangle : ");
  91.    scanf("%d", &length);
  92.  
  93.    printf("\nEnter the Breadth of Rectangle : ");
  94.    scanf("%d", &breadth);
  95.  
  96.    area = length * breadth;
  97.    printf("\nArea of Rectangle : %d \n", area);
  98.  
  99.     int side, sqr;
  100.  
  101.    printf("\nEnter the Length of Side : ");
  102.    scanf("%d", &side);
  103.  
  104.    sqr = side * side;
  105.    printf("\nArea of Square : %d \n", sqr);
  106.  
  107.  
  108. }
Add Comment
Please, Sign In to add comment