Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include<stdio.h>
- int main()
- {
- int arr[1000];
- int i,n;
- printf("Enter number ");
- scanf("%d",&n);
- for(i=0;i<n;i++)
- {
- scanf("%d",&arr[i]);
- }
- for(i=0;i<n/2;i++)
- {
- printf("%d ",arr[i]);
- }
- printf("\n");
- for(i=n/2;i<n;i++)
- {
- printf("%d ",arr[i]);
- }
- return 0;
- }
- #include<stdio.h>
- int main()
- {
- int arr[1000];
- int i,n;
- printf("Enter number ");
- scanf("%d",&n);
- for(i=0;i<n;i++)
- {
- scanf("%d",&arr[i]);
- }
- for(i=0;i<=n/2;i++)
- {
- printf("%d ",arr[i]);
- }
- printf("\n");
- for(i=n/2 +1;i<n;i++)
- {
- printf("%d ",arr[i]);
- }
- return 0;
- }
- #include<stdio.h>
- int main()
- {
- int arr[1000];
- int i,n;
- printf("Enter number ");
- scanf("%d",&n);
- for(i=0;i<n;i++)
- {
- scanf("%d",&arr[i]);
- }
- for(i=0;i<n/3;i++)
- {
- printf("%d ",arr[i]);
- }
- printf("\n");
- for(i=n/3;i<n/3 +3;i++)
- {
- printf("%d ",arr[i]);
- }
- printf("\n");
- for(i=n/3 +3;i<n;i++)
- {
- printf("%d ",arr[i]);
- }
- return 0;
- }
- #include<stdio.h>
- int main()
- {
- int arr[1000];
- int avg=0,i,n,sum=0;
- printf("Enter number ");
- scanf("%d",&n);
- for(i=0;i<n;i++)
- {
- scanf("%d",&arr[i]);
- }
- for(i=0;i<n;i++)
- {
- //printf("%d",arr[i]);
- sum=sum+arr[i];
- }
- printf("%d",sum);
- for(i=0;i<n;i++)
- {
- avg=sum/n;
- }
- printf("\n Average is %d",avg);
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement