[ create a new paste ] login | about

Link: http://codepad.org/Doo1r1qK    [ raw code | output | fork ]

C, pasted on Nov 24:
#include<stdio.h>
#include<conio.h>
#include<string.h>
#include<stdlib.h>
#include<math.h>
int STRLEN(char s[])
{
	int count = 0;
	while (s[count] != '\0')
	{
		count++;
	}
	return count;
}

void STRLWR(char s[])
{
	int length = STRLEN(s);
	for (int i = 0; i < length; i++)
	{
		if (s[i] >= 'A' && s[i] <= 'Z')
		{
			s[i] += 32;
		}
	}
}
int main()
{
	char str1[100];

    printf("Nhap chuoi: ");
	//scanf("%s",str2);
    gets(str1);  // phải dùng gets
	STRLWR(str1);
	printf("\nDoi chu hoa thanh chu thuong: %s", str1);


	getch();
	return 0;
}


Output:
1
2
3
Line 17: error: conio.h: No such file or directory
In function 'STRLWR':
Line 19: error: 'for' loop initial declaration used outside C99 mode


Create a new paste based on this one


Comments: