Download presentation
Presentation is loading. Please wait.
1
ENGR 3 rocks
2
How do you want the review session for the final?
3
MATLAB ! – It’s actually a fancy C program (user friendly) – Runs on linux.engr.ucsb.edu – Runs on your windows or mac computer too – Costs $1,000s (up to 10s of $1000s) but for students it’s cheap! – The help files are AWESOME! – Only two disadvantages…..
4
#include int main () { int N, D, maxD, bestN=3, bestD=1; float pi=3.1415926; scanf(“Enter”,&maxD) for (D=1;D<=maxD;D++){ if(fabs(pi-(float)bestN/bestD)>fabs(pi-(float)N/D)){ bestN=N; bestD=D; } printf(“The best N was %f”,N);
5
#include int main () { int N, D, maxD, bestN=3, bestD=1; float pi=3.1415926; scanf(“Enter”,&maxD) for (D=1;D<=maxD;D++){ if(fabs(pi-(float)bestN/bestD)>fabs(pi-(float)N/D)){ bestN=N; bestD=D; } printf(“The best N was %f”,N);
Similar presentations
© 2024 SlidePlayer.com. Inc.
All rights reserved.