Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Newcomers » Newcomers » input first, then output..:((configuration)
input first, then output..:( [message #1122776] Tue, 01 October 2013 23:11 Go to next message
Alessandro Raco is currently offline Alessandro RacoFriend
Messages: 3
Registered: October 2013
Junior Member
hi this is my code

#include <stdio.h>
#include <stdlib.h>
int main (void)
{
int km, litri, km_totali, litri_totali, contatore, immissione;
float consumo, consumo_medio;

km=0;
litri=0;
km_totali=0;
litri_totali=0;
consumo=0;
consumo_medio=0;
contatore=1;
immissione=1;

while( immissione == 1 )
{
printf("\ninserimento dati %d\n", contatore);
printf("\ninserisci km effettuati: ");
scanf("%d", &km);
printf("inserisci litri consumati: ");
scanf("%d", &litri);
consumo= km / litri;
printf("\nconsumo medio e: %.2f", consumo);
km_totali= km + km_totali;
litri_totali= litri + litri_totali;
consumo_medio= km_totali / litri_totali;
contatore++;
printf("\nProcedere con una nuova immissione?(1/0)");

scanf("%d", &immissione);

}


printf("\nfine inserimento dati carburante");

printf("\n\nil consumo medio totale e %.2f", consumo_medio);

return 0;

}

the output gives me a blank page, a cursor, no "printf" out, but it takes the variables, anyway.
if i type in order "24 (enter) 3 (enter)0"
here it comes the printf out
it works with ALL of my code, all! so i'm quite sure it's just a IDE setting problem.
where am i wrong?please!
Re: input first, then output..:( [message #1122918 is a reply to message #1122776] Wed, 02 October 2013 02:52 Go to previous message
Russell Bateman is currently offline Russell BatemanFriend
Messages: 3798
Registered: July 2009
Location: Provo, Utah, USA
Senior Member

On 10/01/2013 05:15 PM, Alessandro Raco wrote:
> hi this is my code
>
> [snip]

Please read the sticky posts at the top of this forum, namely:

http://www.eclipse.org/forums/index.php/t/161206/
Previous Topic:How can I patch a Drupal Module with Eclipse
Next Topic:Menu item constantly disabled
Goto Forum:
  


Current Time: Sun Mar 07 18:50:12 GMT 2021

Powered by FUDForum. Page generated in 0.03219 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top