Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- int main()
- {
- char tel[11] = {0};
- char tel2[15] = {'(', '0', '0', ')', '0', '0', '/', '0', '0', '0', '-', '0', '0', '0', '0'}; //(xx)xx-xxx-xxxx
- int i;
- printf("Kerem a telefonszamot: ");
- scanf("%s",&tel);
- tel2[1] = tel[0];
- tel2[2] = tel[1];
- tel2[4] = tel[2];
- tel2[5] = tel[3];
- tel2[7] = tel[4];
- tel2[8] = tel[5];
- tel2[9] = tel[6];
- tel2[11] = tel[7];
- tel2[12] = tel[8];
- tel2[13] = tel[9];
- tel2[14] = tel[10];
- for (i = 0; i < 15; i++)
- {
- printf("%c",tel2[i]);
- }
- }
Add Comment
Please, Sign In to add comment