View Code of Problem 43

#define _CRT_SECURE_NO_WARNINGS
#include <stdio.h>
#include <string.h>
#include<math.h>
int main() {//65-90 97-122
	char str[100];
	char str2[100];
	int j=0;
	scanf("%s", &str);
	int len = strlen(str);
	str2[0] = '\0';
	for (int i = 0; i < len; i++) {
		
			if (str[i] >= 'A' && str[i] <= 'Z') {
				str2[j + 1] = str2[j];
				str2[j] = str[i];
				j++;
			}
			else if (str[i] >= 'a' && str[i] <= 'z') {
				str2[j + 1] = str2[j];
				str2[j] = str[i];
				j++;
			}
	}
	int len2 = strlen(str2);
	printf("%s", str2);

}

Double click to view unformatted code.


Back to problem 43