Istanvir389

11/9/17

Sep 11th, 2017
78
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.83 KB | None | 0 0
  1. SPL 11/9/17
  2.  
  3. Array Input
  4.  
  5. Character :
  6.  
  7.  
  8. #include<stdio.h>
  9. int main()
  10. {
  11. int i;
  12. char arr[5];
  13. for(i=0; i<5;i++)
  14. {
  15. scanf("%c",&arr[i]);
  16. printf("\n%c",arr[i]);
  17.  
  18. }
  19. return 0;}
  20.  
  21.  
  22.  
  23. Double :
  24.  
  25.  
  26. #include<stdio.h>
  27. int main()
  28. {
  29. int i;
  30. double arr[5];
  31. for(i=0; i<5;i++)
  32. {
  33. scanf("%lf",&arr[i]);
  34. printf("\n%lf",arr[i]);
  35.  
  36. }
  37. return 0;}
  38.  
  39.  
  40.  
  41.  
  42. Float :
  43.  
  44.  
  45. #include<stdio.h>
  46. int main()
  47. {
  48. int i;
  49. float arr[5];
  50. for(i=0; i<5;i++)
  51. {
  52. scanf("%f",&arr[i]);
  53. printf("\n%f",arr[i]);
  54.  
  55. }
  56. return 0;}
  57.  
  58.  
  59.  
  60. Integer :
  61.  
  62.  
  63. #include<stdio.h>
  64. int main()
  65. {
  66. int i;
  67. int arr[5];
  68. for(i=0; i<5;i++)
  69. {
  70. scanf("%d",&arr[i]);
  71. printf("\n%d",arr[i]);
  72.  
  73. }
  74. return 0;}
Add Comment
Please, Sign In to add comment