Update

One new tab added. Open in browser view if it is not visible. (25/08/2022 08:48)

Zero Ones Equal One Zeros


Problem Code:
ZOOZ

Contest Code:Practice
Submission byrashmi1729
Submitted: 13 days ago

Status:
Correct Answer

Language : C
(NOTE : Try a few times yourself before moving to the solution)


#include <stdio.h>


int main(void) {
	int t;
	scanf("%d\n",&t);
	
	while(t--)
	{
	    int num;
	    scanf("%d\n",&num);
	    
	    char s[num+1];
	    if(num == 3)
	    printf("010\n");
	    else
	    {
    	    printf("1");
    	    for(int i = 0; i < num-2; i++)
    	    printf("0");
    	    
    	    printf("1\n");
	    }
	}
	return 0;
}




No comments: