Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include<stdio.h>
- int main()
- {
- int t,n,m;
- printf("Enter how many test case you want\n");
- scanf("%d",&t);
- for(int i=1;i<=t;i++)
- {
- printf("Test case : %d \n",i);
- printf("How many data you want to netered in queue\n");
- scanf("%d",&n);
- int a[n];
- for(int j=0;j<n;j++)
- {
- scanf("%d",&a[j]);
- }
- printf("M = ");
- scanf("%d",&m);
- printf("\n");
- if(m<n)
- {
- for(int j=0;j<m;j++)
- {
- printf("%d ",a[j]);
- }
- printf("\n");
- printf("In Queue : ");
- for(int j=m;j<n;j++)
- {
- printf("%d ",a[j]);
- }
- printf("\n");
- }
- if(m>=n)
- {
- for(int j=0;j<n;j++)
- {
- printf("%d ",a[j]);
- }
- printf("\nIn Queue : Empty\n\n");
- }
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment