Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- SPL 11/9/17
- Array Input
- Character :
- #include<stdio.h>
- int main()
- {
- int i;
- char arr[5];
- for(i=0; i<5;i++)
- {
- scanf("%c",&arr[i]);
- printf("\n%c",arr[i]);
- }
- return 0;}
- Double :
- #include<stdio.h>
- int main()
- {
- int i;
- double arr[5];
- for(i=0; i<5;i++)
- {
- scanf("%lf",&arr[i]);
- printf("\n%lf",arr[i]);
- }
- return 0;}
- Float :
- #include<stdio.h>
- int main()
- {
- int i;
- float arr[5];
- for(i=0; i<5;i++)
- {
- scanf("%f",&arr[i]);
- printf("\n%f",arr[i]);
- }
- return 0;}
- Integer :
- #include<stdio.h>
- int main()
- {
- int i;
- int arr[5];
- for(i=0; i<5;i++)
- {
- scanf("%d",&arr[i]);
- printf("\n%d",arr[i]);
- }
- return 0;}
Add Comment
Please, Sign In to add comment