Struct

  • November 2019
  • PDF

This document was uploaded by user and they confirmed that they have the permission to share it. If you are author or own the copyright of this book, please report to us by using this DMCA report form. Report DMCA


Overview

Download & View Struct as PDF for free.

More details

  • Words: 102
  • Pages: 2
#include<stdio.h> #include #include<string.h> #include<stdlib.h> void main(){ struct registro{ int num; char nome[20],curso[6],disc[6]; float nota1,nota2,media; }reg,reg1; int i,tnome,nomea=0,taprov=0,aprov=0; float media=0;

strcpy(reg1.nome,""); strcpy(reg.nome,""); for(i=0;i<3;i++){ textbackground(0); clrscr(); printf("insira o nome do aluno \n"); fflush(stdin); gets(reg.nome); tnome=strlen(reg.nome); nomea=strlen(reg1.nome); if(tnome>nomea)strcpy(reg1.nome, reg.nome);

printf("digite o n� do aluno\n"); fflush(stdin); scanf("%d",®.num); printf("insira o curso do aluno\n"); fflush(stdin); gets(reg.curso); printf("insira a disciplina do aluno\n"); fflush(stdin); gets(reg.disc);

printf("insira a nota1 do alunos\n"); fflush(stdin); scanf("%f",®.nota1); printf("insira o nota2 do alunos\n"); fflush(stdin); scanf("%f",®.nota2); reg.media=reg.nota1+reg.nota2/2; media=(reg.media/20)*100; if(media>7) aprov++; } taprov=aprov-20;

printf(" o maior nome � %s com %d caracter\n",reg1.nome,nomea); printf(" a m�dia aprovados\n"); getch();

}

da turma � %2.f com o total de %d alunos

Related Documents

Struct
June 2020 12
Struct
April 2020 11
Struct
June 2020 12
Struct
November 2019 22
Data-struct
November 2019 20
Struct~1
October 2019 13