Welcome, guest! Login / Register - Why register?
Psst.. new poll here.
Psst.. new forums here.

Paste

Pasted as C++ by registered user xujiayu ( 4 years ago )
#include <stdio.h>
#include <conio.h>


//doi ky tu hoa sang thuong 
/* A => MA ASCII LA 65
   a => MA ASCII LA 65 
   */
void nhap (char &x) //tham chieu // cai nay cua thu tuc chi co the tai su dung hien thi , khong tai su dung duoc cai phe tinh mang ket qua 
{
	 printf("\nHay nhap ki tu : ");
	 scanf("%c",&x);
}
 char biendoi (char x) // cai nay cua ham , neu phan duoi can minh co the su dung lai duoc cai x de tinh  
 {
      if( x >= 'A' && x <= 'Z')
	  {
	      x += 32;
	  }
	  return x;
 }
 void biendoi_2(char &x) //ham thu tuc van lam phep tinh duoc nhung khong the tao 1 bien moi de nhan ket qua , chi co the thay doi ket qua nho tham chieu nhan ket qua thay doi 
 {
    if( x >= 'A' && x <= 'Z')
	  {
	      x += 32;
	  }
 }


int main()
{     
	char x;
	nhap (x);
	//char c = biendoi(x); // cach 1 
	biendoi_2(x);
	printf("\nSau khi bien doi : %c ",x);

	getch();
	return 0;



}

 

Revise this Paste

Your Name: Code Language: