





















Estude fácil! Tem muito documento disponível na Docsity
Ganhe pontos ajudando outros esrudantes ou compre um plano Premium
Esta página não é visível na pré-visualização
Não perca as partes importantes!






















Departamento de Tecnologia da Informação
Faculdade de Tecnologia de São Paulo
O
O
#include <stdio.h>#include <conio.h>main() {
float a, b, m;clrscr();printf("\nInforme as duas notas obtidas:");scanf("%f %f", &a, &b);m = (a+b)/2;if( m>=7.0 ) printf("\nAprovado");else
printf("\nReprovado");
getch();
#include <stdio.h>#include <conio.h>main() { }
float a, b, m;clrscr();printf("\nInforme as duas notas obtidas:");scanf("%f %f", &a, &b);m = (a+b)/2;if( m>=7.0 ) printf("\nAprovado");else
printf("\nReprovado");
getch();
...if( m>=7.0 ) {
textcolor(BLUE);cprintf("\nAprovado"); } else {
textcolor(RED);cprintf(“\nReprovado");
...if( m>=7.0 ) } ...
textcolor(BLUE);cprintf("\nAprovado"); } else
textcolor(RED);cprintf(“\nReprovado"); } ...
#include <stdio.h>#include <conio.h>main() {
int a;clrscr();printf("\nAno? "); scanf("%d", &a);if( !(a%4) && a%100 || !(a%400) )
printf("\nÉ bissexto"); else
printf("\nNão é bissexto"); getch(); #include <stdio.h>#include <conio.h>main() { }
int a;clrscr();printf("
\n
Ano? "); scanf("%d", &a);
if(
!(a%4) && a%100 || !(a%400)
printf("
\n
É bissexto");
else
printf("
\n
Não é bissexto");
getch();
#include <stdio.h>#include <conio.h>main() {
int H;float S;clrscr();printf("\nHoras trabalhadas?"); scanf("%d" , &H);S = H*19.50;
/* salário bruto */
if(S>1500.00) S = 0.90*S;
/* desconta IR
printf("\nSalário líquido: R$ %.2f", S);getch();
#include <stdio.h>#include <conio.h>main() { }
int H;float S;clrscr();printf("
\n
Horas trabalhadas?"); scanf(
"%d"
/* salário bruto */
if(S>1500.00) S = 0.90*S;
/* desconta IR
printf("
\n
Salário líquido: R$ %.2f", S);
getch();
ççção
ãoãoão
????
expressãoexpressãoexpressãoexpressão
::::
expressãoexpressãoexpressãoexpressão
o^
o^
o^
#include <stdio.h>#include <conio.h>main() {
int x, y;clrscr();printf("\nInforme dois valores: ");scanf("%d %d", &x, &y);printf("\nMáximo = %d", x>y? x : y);getch();
#include <stdio.h>#include <conio.h>main() { }
int x, y;clrscr();printf("\nInforme dois valores: ");scanf("%d %d", &x, &y);printf("\nMáximo = %d",
x>y? x : y
getch();
^
^
^
#include <stdio.h>#include <conio.h>main() { float a, b, c;clrscr();printf("\nInforme três números:");scanf("%f %f %f", &a, &b, &c);if( a<b+c && b<a+c && c<a+b ) {
puts("\nÉ um triângulo: ");if( A==B && B==C ) puts("equilátero");else if( a==b || a==c || b==c) puts("isósceles");else puts("escaleno"); } else puts("\nNão é um triângulo");getch(); #include <stdio.h>#include <conio.h>main() {float a, b, c;clrscr();printf("\nInforme três números:");scanf("%f %f %f", &a, &b, &c);^ if( a<b+c && b<a+c && c<a+b ) {}
puts("\nÉ um triângulo: "); if( A==B && B==C )
puts("equilátero");
else
if( a==b || a==c || b==c)
puts("isósceles");
else
puts("escaleno");
} else
puts("\nNão é um triângulo");
getch(); }
#include <stdio.h>#include <conio.h>main() {
float a, b, m;printf("\nNotas? "); scanf("%f %f", &a, &b);m = (a+b)/2;if( m>=7.0 ) {
textcolor(BLUE); cprintf("\nAprovado"); } else if( m<3.0 ) {
textcolor(RED); cprintf("\nReprovado"); } else {
textcolor(YELLOW); cprintf("\nAprovado"); } getch(); #include <stdio.h>#include <conio.h>main() { }
float a, b, m;printf("\nNotas? "); scanf("%f %f", &a, &b);m = (a+b)/2; if( m>=7.0 ) {
textcolor(BLUE); cprintf("\nAprovado"); } else
if( m<3.0 ) { textcolor(RED); cprintf("\nReprovado"); } else {
textcolor(YELLOW); cprintf("\nAprovado"); } getch(); }
o^
#include <stdio.h>#include <conio.h>#include <math.h>main() {
float a, b, c, d, x1, x2;clrscr();printf("\nCoeficiente a? ");scanf("%f", &a);if( a!=0 ) {
printf("\nCoeficiente b? ");scanf("%f", &b);printf("\nCoeficiente c? ");scanf("%f", &c);
#include <stdio.h>#include <conio.h>#include <math.h>main() {
float a, b, c, d, x1, x2;clrscr();printf("\nCoeficiente a? ");scanf("%f", &a); if( a!=0 ) {
printf("\nCoeficiente b? ");scanf("%f", &b);printf("\nCoeficiente c? ");scanf("%f", &c);