Advertisement
zaman360live

Quiz03Solve

Apr 23rd, 2021
793
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 1.37 KB | None | 0 0
  1. Quiz03 Solve:
  2.  
  3. /* By the Name of Allah
  4. Student ID: 211-15-4031
  5. Name: Md. Shamsuzzaman
  6. Solve For Quiz3-Ques01*/
  7. #include <stdio.h>
  8. int main()
  9. {
  10.     double n1, n2, n3;
  11.     printf("Enter three different numbers: ");
  12.     scanf("%lf %lf %lf", &n1, &n2, &n3);
  13.     if (n1 >= n2 && n1 >= n3)
  14.         printf("%.2f is the largest number.", n1);
  15.     if (n2 >= n1 && n2 >= n3)
  16.         printf("%.2f is the largest number.", n2);
  17.     if (n3 >= n1 && n3 >= n2)
  18.         printf("%.2f is the largest number.", n3);
  19.  
  20.     return 0;
  21. }
  22.  
  23. =========================
  24.  
  25. /* By the Name of Allah
  26. Student ID: 211-15-4031
  27. Name: Md. Shamsuzzaman
  28. Solve For Quiz3-Ques02*/
  29. #include <stdio.h>
  30.  
  31. int main()
  32. {
  33.     int i,evenx4031;
  34.     printf("Inter a Number to find total  Even & list \n");
  35.     scanf("%d", &evenx4031);
  36.     printf("Total Even= %d\n",evenx4031/2);
  37.     printf("Even numbers between 1 to %d (inclusive):\n",evenx4031);
  38.     for (i = 1; i <= evenx4031; i++)
  39.     {
  40.         if (i % 2 == 0)
  41.         {
  42.             printf("%d ", i);
  43.         }
  44.     }
  45.     return 0;
  46. }
  47. ===============================
  48. /* By the Name of Allah
  49. Student ID: 211-15-4031
  50. Name: Md. Shamsuzzaman
  51. Solve For Quiz3-Ques03*/
  52. #include <stdio.h>
  53. int main()
  54. {
  55.     char name[100];
  56.     printf("What's Your Name?:\n ");
  57.     gets(name);
  58.     printf("Your Name: %s\n", name);
  59.  
  60.     return 0;
  61. }
  62. ----------------
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement