Click here to Skip to main content
14,766,501 members
Home » Discussions » C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Windows Compatibility Mode Pin
David Crow6-May-16 4:28
MemberDavid Crow6-May-16 4:28 
GeneralRe: Windows Compatibility Mode Pin
Bram van Kampen3-Jul-16 15:04
MemberBram van Kampen3-Jul-16 15:04 
GeneralRe: Windows Compatibility Mode Pin
Bram van Kampen2-Jul-16 16:52
MemberBram van Kampen2-Jul-16 16:52 
QuestionStuck in 2 loops Pin
Member 124990122-May-16 19:59
MemberMember 124990122-May-16 19:59 
GeneralRe: Stuck in 2 loops Pin
PIEBALDconsult2-May-16 20:13
professionalPIEBALDconsult2-May-16 20:13 
GeneralRe: Stuck in 2 loops Pin
Member 124990122-May-16 20:26
MemberMember 124990122-May-16 20:26 
GeneralRe: Stuck in 2 loops Pin
Richard MacCutchan2-May-16 22:29
mveRichard MacCutchan2-May-16 22:29 
GeneralRe: Stuck in 2 loops Pin
Member 124990123-May-16 0:43
MemberMember 124990123-May-16 0:43 
#include <stdio.h>
#include <math.h>
#include <string.h>

int i;
float volt[6];
float avg, avg10, avg15, total, a, b;

    int main () {

  total= 0 ;
  avg = 0;
  printf("Enter 6 Volts of Machine\n");

   for ( i=0; i<6; i++) {
   printf("Type %d. volt", i+1);
    scanf("%f",&volt[i]);

  total = total + volt[i];
}
avg = total/6;
avg10 = (avg * 10) / 100;
avg15 = (avg * 15) / 100;
printf("------------------------------------------\n");
printf("The machine Avarage Voltage is %.2f\n", avg);
printf("The Machine  Avarage is%.2f\n", avg10);
printf("The Machine 15 Avarage is%.2f\n\n\n", avg15);


     for (i=0;i<6;i++) {
      a = fabs(volt[i] - avg);
    
      if( a > avg10 ) {
     printf("\nVoltage at hour %d was %.2f volts (diffrence of %.2f volts)\n\n", i+1, volt[i], a);
       }
   }


     for (i=0; i<5; i++) {

       b = fabs(volt[i+1] - volt[i]);
       if( b > avg15) {
     printf("\nVoltage change from hour %d to hour %d was %.2f\n\n", i+1, i+2, b);
       }
   }

}

QuestionRe: Stuck in 2 loops Pin
Parthiban.Appuswamy3-May-16 2:31
MemberParthiban.Appuswamy3-May-16 2:31 
AnswerRe: Stuck in 2 loops Pin
Member 124990123-May-16 2:36
MemberMember 124990123-May-16 2:36 
GeneralRe: Stuck in 2 loops Pin
Richard MacCutchan3-May-16 3:26
mveRichard MacCutchan3-May-16 3:26 
GeneralRe: Stuck in 2 loops Pin
Member 124990123-May-16 3:47
MemberMember 124990123-May-16 3:47 
GeneralRe: Stuck in 2 loops Pin
Richard MacCutchan3-May-16 3:55
mveRichard MacCutchan3-May-16 3:55 
AnswerRe: Stuck in 2 loops Pin
Patrice T5-May-16 0:24
mvePatrice T5-May-16 0:24 
GeneralRe: Stuck in 2 loops Pin
Richard MacCutchan5-May-16 1:26
mveRichard MacCutchan5-May-16 1:26 
GeneralRe: Stuck in 2 loops Pin
Patrice T5-May-16 1:52
mvePatrice T5-May-16 1:52 
GeneralRe: Stuck in 2 loops Pin
Richard MacCutchan5-May-16 2:08
mveRichard MacCutchan5-May-16 2:08 
Questiondotted rectangle is not being cleared if any empty string added in MFC comboboc Pin
Amrit Agr1-May-16 20:57
MemberAmrit Agr1-May-16 20:57 
AnswerRe: dotted rectangle is not being cleared if any empty string added in MFC comboboc Pin
leon de boer2-May-16 18:57
Memberleon de boer2-May-16 18:57 
QuestionCreation of class members of class created on the heap Pin
ForNow30-Apr-16 20:09
MemberForNow30-Apr-16 20:09 
AnswerRe: Creation of class members of class created on the heap Pin
Richard MacCutchan30-Apr-16 21:38
mveRichard MacCutchan30-Apr-16 21:38 
QuestionFIFO en languge C Pin
Member 1249381829-Apr-16 11:37
MemberMember 1249381829-Apr-16 11:37 
AnswerRe: FIFO en languge C Pin
Bram van Kampen29-Apr-16 12:48
MemberBram van Kampen29-Apr-16 12:48 
AnswerRe: FIFO en languge C Pin
Patrice T30-Apr-16 22:29
mvePatrice T30-Apr-16 22:29 
AnswerRe: FIFO en languge C Pin
CPallini1-May-16 21:49
mveCPallini1-May-16 21:49 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.