Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // apple xcode
- // paulogp
- /* scanf */
- #include <stdio.h>
- #include <stdlib.h> // atoi
- int main (int argc, const char * argv[])
- {
- char the_name[20];
- int the_age;
- printf("indique o seu nome: ");
- scanf("%s", &the_name);
- printf("indique a sua idade: ");
- scanf("%i", &the_age);
- printf("nome apresentado: %s, idade: %i!\n", the_name, the_age);
- char the_string_num[2] = "12";
- the_age = atoi(the_string_num);
- printf("string para inteiro: %i!\n", the_age);
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement