GoConqr has a new look! Let us know what you think.

Mind map

EEX0006 - TEMA 3/6B - PROGRAMAÇÃO C - COMANDOS DE ENTRADA E SAÍDA

Deleted user User has deleted their subject information English

Map content

EEX0006 - TEMA 3/6B - PROGRAMAÇÃO C - COMANDOS DE ENTRADA E SAÍDA

  1. Aplicar os comandos de saída de dados

    • PROGRAMA X LINGUAGEM C
      • programa é uma sequência de instruções dadas para resolver um problema
      • linguagem C é a forma de dar essas orientações ao computador
    • execução
      • Usam-se as chaves { } para delimitar o que está incluso no corpo dessa função
      • função printf()
        • #include void main(){ printf("Hello World"); } resultado: Hello World
        • realizar a escrita na tela
        • exibe o parâmetro recebido dentro dos parênteses
        • string (cadeia de caracteres) fica entre aspas
        • não faz a quebra de linha automática ao final da string
          • inserir o caractere especial ‘\n’
        • variáveis
          • int - %d
            • #include void main(){ int a = 10; char ch = 'Z'; printf("Atualmente, temos a = %d e ch = %c.\n", a, ch); } resultado será:  Atualmente, temos a = 10 e ch = Z.
          • char - %c
            • void main(){ char ch1, ch2, ch3; ch1 = 'H'; ch2 = 'o'; ch3 = 'W'; printf("%cell%c% corld.\n", ch1, ch2, ch3); } Hello World.
          • float
            • seis casas decimais
              • reduzir, utiliza-se %.1f, %.2f
        • TIPO/FORMATO/OBS.
          • char %c Um único caractere
          • int %d ou %i Um inteiro (Base decimal)
          • int %o Um inteiro (Base octal)
          • int %x ou %X Um inteiro (Base hexadecimal)
          • short int %hd Um short inteiro (Base decimal)
          • long int %ld Um long inteiro (Base decimal)
          • unsigned short int %hu Short inteiro positivo
          • unsigned int %u Inteiro positivo
          • unsigned long int %lu Long inteiro positivo
          • float %f ou %e ou %E
          • %f ou %e ou %E
        • Outra função que pode ser usada para a escrita na tela é a puts()

Information

Description
User has deleted their subject information Mind Map on EEX0006 - TEMA 3/6B - PROGRAMAÇÃO C - COMANDOS DE ENTRADA E SAÍDA, created by Deleted user on 14/10/2020.
Created by
Deleted user
Views
9
History
  • Created by Anselmo SC · Sep 24, 2020
  • Copied by Anselmo SC · Oct 14, 2020
Rating

Feedback

What is it about?

What do you think of the new look?

How do you like it?