Questões de Concurso Militar EsFCEx 2013 para Oficial - Informática
Foram encontradas 6 questões
#include <stdio.h>
int main () {
int numero = 20;
printf ("%o + %x = %04d", numero, numero, numero * 5);
}
#include <stdio.h>
int main ( ) {
int v [ ] = {20, 35, 76, 80};
int *a;
a = &v [1];
--(*++a);
(*a--)= (*++a) + 1;
(*a) = --(*--a);
printf ("%d, %d, %d, %d\n", v[0], v[1], v[2], v[3]);
}
São palavras reservadas da linguagem C no padrão ANSI e, portanto, não podem ser utilizadas como nomes de variáveis em programas inscritos nesta linguagem:
I. overall.
II. union.
III. extern.
IV.signed.
V. code.
#include <stdio.h>
int funcao (int *x, int y)
{
if (y > 9)
return (1);
else
if (x [y] > 3)
return (x [y] + funcao (x, y+1 ));
else
return (x [y] * funcao (x, y+1));
}
int main ()
{
int vetor [ ] = {1,1,2,3,4,5,6,7,8,9};
int resultado = funcao (vetor, 0);
for (int i=0; i < 10; ++i) {
printf ("%d" , vetor [i]);
if (i<9)
printf (",");
}
}
public class Codigo {
public static void main(String[ ] args)
{
try { throwException (); }
catch (Exception exception) { System.out.printf (" 1 ");}
}
public static void throwException () throws Exception
{
try { System.out.printf (" 2 "); throw new Exception (); }
catch (RuntimeException runtimeException) { System.out.printf (" 3 ");}
finally {System.out.printf (" 4 ");}
}
}
Teremos como saída a sequência: