שאלה דחופה למומחי C++!!!!
יש לי בחינה ומחר והינה שאלת חזרה שניתנה לי:
יש לי בחינה ומחר והינה שאלת חזרה שניתנה לי:
#include<iostream.h> float second=50; void mystery (float&first) { float imp=10; first-=imp; imp++; second+=first; cout<<second; float second=imp; imp++; cout<<" "<<second<<endl; cout<<imp<<" "<<first<<endl; } void main (void) { float last=24; while(last>12) mystery(last); cout<<second<<endl; }
והפלט יוצא כך: 64 11 12 14 68 11 12 4 68 ושאלתי : מדוע בהרצה השניה של הלולאה SECOND=68???? אודה לעזרתכם המהירה !!!!!!!!!!!!!!