SlideShare a Scribd company logo
1 of 13
Download to read offline
2015
JAVA
Nieldo Gonçalves/Caroline Cesar/Jonathas
Aguiar/Thais Patrício
7/11/2015
Programas em C
Autores:
Nieldo Gonçalves/Caroline Cesar/Jonathas
Aguiar/Thais Patrício
Prof.Miguel Gabriel Prazeres de Carvalho
1
Sumário
Programa diz se o número é par ou ímpar...................................................................................................2
Programa Soma ............................................................................................................................................4
CONTAR OS NUMEROS PARES DE 0 A 1000 ................................................................................................5
CONTADOR DE NUMEROS IMPARES DE 0 A 1000........................................................................................6
TODAS AS COMBINAÇOES DA MEGASENA...................................................................................................7
QUANTIDADE DE PAPEL ( QUESTAO DA OBI) ...............................................................................................8
TIRA TEIMA ( OBI )........................................................................................................................................9
TRIANGULOS...............................................................................................................................................10
Repetição....................................................................................................................................................11
2
Programa diz se o número é par ou ímpar.
#include <stdio.h>
#include <conio.h>
int main (){
int N;
puts ("Digie o numero");
scanf ("%d",&N);
if (N%2==0){
puts ("Par");
}
else {
puts ("Impar");
}
getch ();
return 0;
}
Volume do cubo
#include <stdio.h>
#include <conio.h>
#include <math.h>
int main (){
float N,A;
puts ("Digite o valor da aresta");
scanf ("%f",&N);
3
A=pow(N,3);
printf ("Resultado %.2f",A);
getch ();
return 0;
}
Distancia entre dois pontos:
#include <stdio.h>
#include <conio.h>
#include <math.h>
int main (){
float X1,X2,Y1,Y2,D;
puts ("Digite X1");
scanf ("%f",&X1);
puts ("Digite X2");
scanf ("%f",&X2);
puts ("Digite Y1");
scanf ("%f",&Y1);
puts ("Digite Y2");
scanf ("%f",&Y2);
D=sqrt(pow(X1-X2,2)+pow(Y1-Y2,2));
printf ("Resultado %.2f",D);
getch ();
return 0;
}
4
Programa Soma
#include<stdio.h>
#include<conio.h>
int main (){
int n1,n2,s;
puts ("Digite N1");
scanf("%d",&n1);
puts("Digite N2");
scanf("%d",&n2);
s=n1+n2;
printf("Resultado %d",s);
getch ();
return 0;
}
CONTAR OS NUMEROS DE 0 A 1000
#include <stdio.h>
#include <conio.h>
int main () {
int i=0 ;
for ( i=0; i<=1000; i++){
printf ("%d ",i);
}
getch ();
return 0;
5
}
CONTAR OS NUMEROS PARES DE 0 A 1000
#include <stdio.h>
#include <conio.h>
int main () {
int i=0 ;
for ( i=0; i<=1000; i++){
if ( i%2 ==0) {
printf ("%d ",i);
}
}
getch ();
return 0;
}
6
CONTADOR DE NUMEROS IMPARES DE 0 A
1000
#include <stdio.h>
#include <conio.h>
int main () {
int i=0 ;
for ( i=0; i<=1000; i++){
if (!(i%2 ==0)) {
printf ("%d ",i);
}
}
getch ();
return 0;
}
7
TODAS AS COMBINAÇOES DA MEGASENA
#include <stdio.h>
#include <conio.h>
int main () {
int i,j,k,l,m,n;
for ( i=1; i<=60; i++) {
for ( j=1; j<=60; j++) {
for ( k=1; k<=60; k++) {
for ( l=1; l<=60; l++) {
for ( m=1; m<=60; m++) {
for ( n=1; n<=60; n++) {
if ( i!=j && j!=k && k!=l && l!=m && m!=n && i!=k && i!=l && i!=m && i!=n && j!=n && k!=m && k!=n) {
printf ("%d - %d - %d - %d - %d - %d n", i,j,k,l,m,n);
}}}}}}}
getch ();
return 0;
}
8
QUANTIDADE DE PAPEL ( QUESTAO DA OBI)
#include <stdio.h>
#include <conio.h>
int main () {
int C,F,P;
puts (" Digite o numero de folhas.");
scanf ("%d",&P);
puts (" Digite o numero de competidores.");
scanf ( "%d",&C);
puts (" Digite a quantidade de folhas que o competidor deve receber.");
scanf ("%d",&F);
if (C*F<=P) {
puts ("E suficiente.");
}
else {
puts ("Nao e suficiente.");
}
getch ();
return 0;
}
9
TIRA TEIMA ( OBI )
#include <stdio.h>
#include <conio.h>
int main () {
float X,Y;
puts ("Digite as coordenadas do ponto.");
scanf ("%f %f",&X,&Y);
if ( 0<=X && X<= 432 && 0<=Y && Y<= 468){
puts ("Dentro.");
}
else {
puts ("Fora.");
}
getch ();
return 0;
}
10
TRIANGULOS
#include <stdio.h>
#include <conio.h>
#include <math.h>
int main () {
float A,B,C;
puts ("Digite a medida dos lados.");
scanf ("%f %f %f",&A,&B,&C);
if (A> B+C || B>A+C || C>A+C){
puts ("Nao e um triangulo.");
}
else if (pow(A,2)<pow(B,2)+pow(C,2)){
puts ("a");
}
else if ( pow(A,2)>pow(B,2)+pow(C,2)){
puts ("o");
}
else if
(pow(A,2)==pow(B,2)+pow(C,2)||pow(B,2)==pow(A,2)+pow(C,2)||pow(C,2)==pow(B,2)+pow(A,2)){
11
puts ("r");}
getch ();
return 0;
}
Repetição
#include <stdio.h>
#include <conio.h>
int main (){
int n;
puts ("Digite a Quantidade.");
scanf ("%d",&n);
int i=0;
while (i<n){
puts ("A");
i++;}
getch ();
return 0;
}
12

More Related Content

Recently uploaded

30 ĐỀ PHÁT TRIỂN THEO CẤU TRÚC ĐỀ MINH HỌA BGD NGÀY 22-3-2024 KỲ THI TỐT NGHI...
30 ĐỀ PHÁT TRIỂN THEO CẤU TRÚC ĐỀ MINH HỌA BGD NGÀY 22-3-2024 KỲ THI TỐT NGHI...30 ĐỀ PHÁT TRIỂN THEO CẤU TRÚC ĐỀ MINH HỌA BGD NGÀY 22-3-2024 KỲ THI TỐT NGHI...
30 ĐỀ PHÁT TRIỂN THEO CẤU TRÚC ĐỀ MINH HỌA BGD NGÀY 22-3-2024 KỲ THI TỐT NGHI...Nguyen Thanh Tu Collection
 
TUYỂN TẬP 20 ĐỀ THI KHẢO SÁT HỌC SINH GIỎI MÔN TIẾNG ANH LỚP 6 NĂM 2020 (CÓ Đ...
TUYỂN TẬP 20 ĐỀ THI KHẢO SÁT HỌC SINH GIỎI MÔN TIẾNG ANH LỚP 6 NĂM 2020 (CÓ Đ...TUYỂN TẬP 20 ĐỀ THI KHẢO SÁT HỌC SINH GIỎI MÔN TIẾNG ANH LỚP 6 NĂM 2020 (CÓ Đ...
TUYỂN TẬP 20 ĐỀ THI KHẢO SÁT HỌC SINH GIỎI MÔN TIẾNG ANH LỚP 6 NĂM 2020 (CÓ Đ...Nguyen Thanh Tu Collection
 
TUYỂN TẬP 25 ĐỀ THI HỌC SINH GIỎI MÔN TIẾNG ANH LỚP 6 NĂM 2023 CÓ ĐÁP ÁN (SƯU...
TUYỂN TẬP 25 ĐỀ THI HỌC SINH GIỎI MÔN TIẾNG ANH LỚP 6 NĂM 2023 CÓ ĐÁP ÁN (SƯU...TUYỂN TẬP 25 ĐỀ THI HỌC SINH GIỎI MÔN TIẾNG ANH LỚP 6 NĂM 2023 CÓ ĐÁP ÁN (SƯU...
TUYỂN TẬP 25 ĐỀ THI HỌC SINH GIỎI MÔN TIẾNG ANH LỚP 6 NĂM 2023 CÓ ĐÁP ÁN (SƯU...Nguyen Thanh Tu Collection
 
French Revolution (फ्रेंच राज्यक्रांती)
French Revolution  (फ्रेंच राज्यक्रांती)French Revolution  (फ्रेंच राज्यक्रांती)
French Revolution (फ्रेंच राज्यक्रांती)Shankar Aware
 
Seth-Godin-–-Tribus-PDFDrive-.pdf en espaoñ
Seth-Godin-–-Tribus-PDFDrive-.pdf en espaoñSeth-Godin-–-Tribus-PDFDrive-.pdf en espaoñ
Seth-Godin-–-Tribus-PDFDrive-.pdf en espaoñcarrenoelio8
 

Recently uploaded (6)

30 ĐỀ PHÁT TRIỂN THEO CẤU TRÚC ĐỀ MINH HỌA BGD NGÀY 22-3-2024 KỲ THI TỐT NGHI...
30 ĐỀ PHÁT TRIỂN THEO CẤU TRÚC ĐỀ MINH HỌA BGD NGÀY 22-3-2024 KỲ THI TỐT NGHI...30 ĐỀ PHÁT TRIỂN THEO CẤU TRÚC ĐỀ MINH HỌA BGD NGÀY 22-3-2024 KỲ THI TỐT NGHI...
30 ĐỀ PHÁT TRIỂN THEO CẤU TRÚC ĐỀ MINH HỌA BGD NGÀY 22-3-2024 KỲ THI TỐT NGHI...
 
TUYỂN TẬP 20 ĐỀ THI KHẢO SÁT HỌC SINH GIỎI MÔN TIẾNG ANH LỚP 6 NĂM 2020 (CÓ Đ...
TUYỂN TẬP 20 ĐỀ THI KHẢO SÁT HỌC SINH GIỎI MÔN TIẾNG ANH LỚP 6 NĂM 2020 (CÓ Đ...TUYỂN TẬP 20 ĐỀ THI KHẢO SÁT HỌC SINH GIỎI MÔN TIẾNG ANH LỚP 6 NĂM 2020 (CÓ Đ...
TUYỂN TẬP 20 ĐỀ THI KHẢO SÁT HỌC SINH GIỎI MÔN TIẾNG ANH LỚP 6 NĂM 2020 (CÓ Đ...
 
LAR MARIA MÃE DE ÁFRICA .
LAR MARIA MÃE DE ÁFRICA                 .LAR MARIA MÃE DE ÁFRICA                 .
LAR MARIA MÃE DE ÁFRICA .
 
TUYỂN TẬP 25 ĐỀ THI HỌC SINH GIỎI MÔN TIẾNG ANH LỚP 6 NĂM 2023 CÓ ĐÁP ÁN (SƯU...
TUYỂN TẬP 25 ĐỀ THI HỌC SINH GIỎI MÔN TIẾNG ANH LỚP 6 NĂM 2023 CÓ ĐÁP ÁN (SƯU...TUYỂN TẬP 25 ĐỀ THI HỌC SINH GIỎI MÔN TIẾNG ANH LỚP 6 NĂM 2023 CÓ ĐÁP ÁN (SƯU...
TUYỂN TẬP 25 ĐỀ THI HỌC SINH GIỎI MÔN TIẾNG ANH LỚP 6 NĂM 2023 CÓ ĐÁP ÁN (SƯU...
 
French Revolution (फ्रेंच राज्यक्रांती)
French Revolution  (फ्रेंच राज्यक्रांती)French Revolution  (फ्रेंच राज्यक्रांती)
French Revolution (फ्रेंच राज्यक्रांती)
 
Seth-Godin-–-Tribus-PDFDrive-.pdf en espaoñ
Seth-Godin-–-Tribus-PDFDrive-.pdf en espaoñSeth-Godin-–-Tribus-PDFDrive-.pdf en espaoñ
Seth-Godin-–-Tribus-PDFDrive-.pdf en espaoñ
 

Featured

2024 State of Marketing Report – by Hubspot
2024 State of Marketing Report – by Hubspot2024 State of Marketing Report – by Hubspot
2024 State of Marketing Report – by HubspotMarius Sescu
 
Everything You Need To Know About ChatGPT
Everything You Need To Know About ChatGPTEverything You Need To Know About ChatGPT
Everything You Need To Know About ChatGPTExpeed Software
 
Product Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage EngineeringsProduct Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage EngineeringsPixeldarts
 
How Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental HealthHow Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental HealthThinkNow
 
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdfAI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdfmarketingartwork
 
PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024Neil Kimberley
 
Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)contently
 
How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024Albert Qian
 
Social Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsSocial Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsKurio // The Social Media Age(ncy)
 
Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Search Engine Journal
 
5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summarySpeakerHub
 
ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd Clark Boyd
 
Getting into the tech field. what next
Getting into the tech field. what next Getting into the tech field. what next
Getting into the tech field. what next Tessa Mero
 
Google's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentGoogle's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentLily Ray
 
Time Management & Productivity - Best Practices
Time Management & Productivity -  Best PracticesTime Management & Productivity -  Best Practices
Time Management & Productivity - Best PracticesVit Horky
 
The six step guide to practical project management
The six step guide to practical project managementThe six step guide to practical project management
The six step guide to practical project managementMindGenius
 
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...RachelPearson36
 

Featured (20)

2024 State of Marketing Report – by Hubspot
2024 State of Marketing Report – by Hubspot2024 State of Marketing Report – by Hubspot
2024 State of Marketing Report – by Hubspot
 
Everything You Need To Know About ChatGPT
Everything You Need To Know About ChatGPTEverything You Need To Know About ChatGPT
Everything You Need To Know About ChatGPT
 
Product Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage EngineeringsProduct Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage Engineerings
 
How Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental HealthHow Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental Health
 
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdfAI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
 
Skeleton Culture Code
Skeleton Culture CodeSkeleton Culture Code
Skeleton Culture Code
 
PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024
 
Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)
 
How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024
 
Social Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsSocial Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie Insights
 
Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024
 
5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary
 
ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd
 
Getting into the tech field. what next
Getting into the tech field. what next Getting into the tech field. what next
Getting into the tech field. what next
 
Google's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentGoogle's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search Intent
 
How to have difficult conversations
How to have difficult conversations How to have difficult conversations
How to have difficult conversations
 
Introduction to Data Science
Introduction to Data ScienceIntroduction to Data Science
Introduction to Data Science
 
Time Management & Productivity - Best Practices
Time Management & Productivity -  Best PracticesTime Management & Productivity -  Best Practices
Time Management & Productivity - Best Practices
 
The six step guide to practical project management
The six step guide to practical project managementThe six step guide to practical project management
The six step guide to practical project management
 
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
 

Revista

  • 1. 2015 JAVA Nieldo Gonçalves/Caroline Cesar/Jonathas Aguiar/Thais Patrício 7/11/2015 Programas em C Autores: Nieldo Gonçalves/Caroline Cesar/Jonathas Aguiar/Thais Patrício Prof.Miguel Gabriel Prazeres de Carvalho
  • 2. 1 Sumário Programa diz se o número é par ou ímpar...................................................................................................2 Programa Soma ............................................................................................................................................4 CONTAR OS NUMEROS PARES DE 0 A 1000 ................................................................................................5 CONTADOR DE NUMEROS IMPARES DE 0 A 1000........................................................................................6 TODAS AS COMBINAÇOES DA MEGASENA...................................................................................................7 QUANTIDADE DE PAPEL ( QUESTAO DA OBI) ...............................................................................................8 TIRA TEIMA ( OBI )........................................................................................................................................9 TRIANGULOS...............................................................................................................................................10 Repetição....................................................................................................................................................11
  • 3. 2 Programa diz se o número é par ou ímpar. #include <stdio.h> #include <conio.h> int main (){ int N; puts ("Digie o numero"); scanf ("%d",&N); if (N%2==0){ puts ("Par"); } else { puts ("Impar"); } getch (); return 0; } Volume do cubo #include <stdio.h> #include <conio.h> #include <math.h> int main (){ float N,A; puts ("Digite o valor da aresta"); scanf ("%f",&N);
  • 4. 3 A=pow(N,3); printf ("Resultado %.2f",A); getch (); return 0; } Distancia entre dois pontos: #include <stdio.h> #include <conio.h> #include <math.h> int main (){ float X1,X2,Y1,Y2,D; puts ("Digite X1"); scanf ("%f",&X1); puts ("Digite X2"); scanf ("%f",&X2); puts ("Digite Y1"); scanf ("%f",&Y1); puts ("Digite Y2"); scanf ("%f",&Y2); D=sqrt(pow(X1-X2,2)+pow(Y1-Y2,2)); printf ("Resultado %.2f",D); getch (); return 0; }
  • 5. 4 Programa Soma #include<stdio.h> #include<conio.h> int main (){ int n1,n2,s; puts ("Digite N1"); scanf("%d",&n1); puts("Digite N2"); scanf("%d",&n2); s=n1+n2; printf("Resultado %d",s); getch (); return 0; } CONTAR OS NUMEROS DE 0 A 1000 #include <stdio.h> #include <conio.h> int main () { int i=0 ; for ( i=0; i<=1000; i++){ printf ("%d ",i); } getch (); return 0;
  • 6. 5 } CONTAR OS NUMEROS PARES DE 0 A 1000 #include <stdio.h> #include <conio.h> int main () { int i=0 ; for ( i=0; i<=1000; i++){ if ( i%2 ==0) { printf ("%d ",i); } } getch (); return 0; }
  • 7. 6 CONTADOR DE NUMEROS IMPARES DE 0 A 1000 #include <stdio.h> #include <conio.h> int main () { int i=0 ; for ( i=0; i<=1000; i++){ if (!(i%2 ==0)) { printf ("%d ",i); } } getch (); return 0; }
  • 8. 7 TODAS AS COMBINAÇOES DA MEGASENA #include <stdio.h> #include <conio.h> int main () { int i,j,k,l,m,n; for ( i=1; i<=60; i++) { for ( j=1; j<=60; j++) { for ( k=1; k<=60; k++) { for ( l=1; l<=60; l++) { for ( m=1; m<=60; m++) { for ( n=1; n<=60; n++) { if ( i!=j && j!=k && k!=l && l!=m && m!=n && i!=k && i!=l && i!=m && i!=n && j!=n && k!=m && k!=n) { printf ("%d - %d - %d - %d - %d - %d n", i,j,k,l,m,n); }}}}}}} getch (); return 0; }
  • 9. 8 QUANTIDADE DE PAPEL ( QUESTAO DA OBI) #include <stdio.h> #include <conio.h> int main () { int C,F,P; puts (" Digite o numero de folhas."); scanf ("%d",&P); puts (" Digite o numero de competidores."); scanf ( "%d",&C); puts (" Digite a quantidade de folhas que o competidor deve receber."); scanf ("%d",&F); if (C*F<=P) { puts ("E suficiente."); } else { puts ("Nao e suficiente."); } getch (); return 0; }
  • 10. 9 TIRA TEIMA ( OBI ) #include <stdio.h> #include <conio.h> int main () { float X,Y; puts ("Digite as coordenadas do ponto."); scanf ("%f %f",&X,&Y); if ( 0<=X && X<= 432 && 0<=Y && Y<= 468){ puts ("Dentro."); } else { puts ("Fora."); } getch (); return 0; }
  • 11. 10 TRIANGULOS #include <stdio.h> #include <conio.h> #include <math.h> int main () { float A,B,C; puts ("Digite a medida dos lados."); scanf ("%f %f %f",&A,&B,&C); if (A> B+C || B>A+C || C>A+C){ puts ("Nao e um triangulo."); } else if (pow(A,2)<pow(B,2)+pow(C,2)){ puts ("a"); } else if ( pow(A,2)>pow(B,2)+pow(C,2)){ puts ("o"); } else if (pow(A,2)==pow(B,2)+pow(C,2)||pow(B,2)==pow(A,2)+pow(C,2)||pow(C,2)==pow(B,2)+pow(A,2)){
  • 12. 11 puts ("r");} getch (); return 0; } Repetição #include <stdio.h> #include <conio.h> int main (){ int n; puts ("Digite a Quantidade."); scanf ("%d",&n); int i=0; while (i<n){ puts ("A"); i++;} getch (); return 0; }
  • 13. 12