View Code of Problem 54

#include<stdio.h>
#include<string.h>
#include<math.h>

int main(){

	
	char a[100];
	gets(a);

	int k=0;
	for(int i=0;i<strlen(a);i++){
		
			if(i!=strlen(a)-1)
			printf("%c ",a[i]);
			else printf("%c",a[i]);
		

		
	
	}
	


/*
Main.c: In function 'main':
Main.c:9:2: warning: 'gets' is deprecated (declared at /usr/include/stdio.h:638) [-Wdeprecated-declarations]
  gets(a);
  ^
Main.c:21:2: error: expected declaration or statement at end of input
  }
  ^
Main.c:11:6: warning: unused variable 'k' [-Wunused-variable]
  int k=0;
      ^
*/

Double click to view unformatted code.


Back to problem 54