Ir para conteúdo
Fórum Script Brasil

Matheus Kun

Membros
  • Total de itens

    2
  • Registro em

  • Última visita

Sobre Matheus Kun

  • Data de Nascimento 08/12/1996

Contatos

  • MSN
    sasukelacerda@hotmail.com

Perfil

  • Gender
    Male

Matheus Kun's Achievements

0

Reputação

  1. Vlw cara, muito obrigado... Funcionou legal :rolleyes: :rolleyes: :rolleyes: :rolleyes: :rolleyes: :rolleyes: :rolleyes: :rolleyes:
  2. Bom, antes de tudo obrigado a quem me ajudar respondendo este tópico. :rolleyes: Antes de Começar: S.O: Linux - Ubuntu11.04 i386 Compilador: Terminal - gcc -------------------------------------------------------- Bom dia. Estava navegando na internet procurando exércícios para programação básica em C, aproveitei e dei uma revisada em outras linguagens escrevendo o mesmo exercício em Ruby, Perl e PYthon, até aí tudo bem, mas quando vou pra C, o terminal acusa um erro q não faço a mínima ideia como resolver: matheus@matheus-ubuntu:~$ cd '/home/matheus/Área de Trabalho/Scripts' matheus@matheus-ubuntu:~/Área de Trabalho/Scripts$ gcc temperatura.c temperatura.c: In function ‘main’: temperatura.c:25:1: warning: format ‘%d’ expects type ‘int’, but argument 2 has type ‘int *’ temperatura.c:34:1: warning: format ‘%d’ expects type ‘int’, but argument 2 has type ‘int *’ temperatura.c:43:1: warning: format ‘%d’ expects type ‘int’, but argument 2 has type ‘int *’ temperatura.c:52:1: warning: format ‘%d’ expects type ‘int’, but argument 2 has type ‘int *’ Aqui vai o código fonte do programa (conversor de temperatura): #include<stdio.h> int main () { int choice; printf ("Selecione a opção:\n"); printf ("1 - Celsius -> Fahrenheit\n"); printf ("2 - Fahrenheit -> Celsius\n"); printf ("3 - Celsius -> Kelvin\n"); printf ("4 - Kelvin -> Celsius\n"); scanf ("%i", &choice); if (choice > 4) { printf ("Escolha Incorreta"); } switch (choice) { case 1: { int c; int f; printf ("Digite o valor em Celsius:\n"); scanf ("%i", &c); f = c*1.8 + 32; printf ("%d", &f); } case 2: { int f; int c; printf ("Digite o valor em Fahrenheit:\n"); scanf ("%i", &f); c = (f - 32) / 1.8; printf ("%d",&c); } case 3: { int c; int k; printf ("Digite o valor em Celsius:\n"); scanf ("%i", &c); k = c + 273.15; printf ("%d", &k); } case 4: { int k; int c; printf ("Digite o valor em Kelvin:\n"); scanf ("%i", &k); c = k - 273.15; printf ("%d", &c); } } } Valendo salientar que funcionou nas outras linguagens. Muito Obrigado :rolleyes:
×
×
  • Criar Novo...