/*hi I'm having problems with my "while ()" apperently it is not taking any action, and it keeps going endless. i need it to stop when the answer is 'n'*/
#include<stdio.h>
#include<conio.h>
#include<stdlib.h>
#include<string.h>
#include<iostream.h>
//---------------------------------------------------------------------------
void main()
{
char pais[20],r;
int i=1,temp=0,ctemp=0,atemp=0,dia=0;
float promt;
clrscr();
fflush(stdin);
cout << "desea registrar paises S/N \n";
cin >> r;
cout << "indique dias anotados por el pais \n";
cin >> dia;
cout << endl;
while (r='s')
{
cout << "\n indique pais de procedencia \n";
cin >> pais;
for (i=1;i<=dia;i++)
{
fflush(stdin);
cout << " indique la temperatura del dia: " << i << ":" ;
cin >> temp;
ctemp++;
atemp=atemp+temp;
}//for i
fflush(stdin);
promt=(atemp/ctemp++);
cout << "\n el promedio de temperatura en \t" << pais << "\t es:" ;
cout << promt;
cout << "\n desea ingresar otro pais? S/N \n";
cin >> r;
};
cout << "tenga un buen dia";
cout << endl;
getch();
}