{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}

Week08 - ENEE 140 Introduction to Programming Concepts for...

Info icon This preview shows pages 1–3. Sign up to view the full content.

View Full Document Right Arrow Icon
ENEE 140: Introduction to Programming Concepts for Engineers [email protected] © Gang Qu Spring 2010 Week 8 Lab report: Write program to answer the questions 3,6, and name them week08_3.c, week08_6.c Submit by the following command: submit 2010 spring enee 140 010? 1 week08_3.c submit 2010 spring enee 140 010? 1 week08_6.c Due: check the two questions. Lab 13: Monday March 28 1. if-else: What will the output of the following code segment? Think about the answer and then check your answer by testing it in a complete program. int a =5; if (a = 0) { printf(“a=0 is true. \n”); } else { printf(“a=0 is not true.\n”); } if (a==0) { printf(“a==0 is true. \n”); } else { printf(“a==0 is not true.\n”); } 2. dangling else problem: What will be the output of the following code segment with different values to x and y? Check your answer by testing it in a complete program. int x,y; scanf(“%d%d”, &x, &y); if (x > 0) if (y>0) printf(“Both positive.\n”); else printf(“x negative, ignore y.\n”); a x = 2, y = 1
Image of page 1

Info icon This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon
ENEE 140: Introduction to Programming Concepts for Engineers [email protected]
Image of page 2
Image of page 3
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}

What students are saying

  • Left Quote Icon

    As a current student on this bumpy collegiate pathway, I stumbled upon Course Hero, where I can find study resources for nearly all my courses, get online help from tutors 24/7, and even share my old projects, papers, and lecture notes with other students.

    Student Picture

    Kiran Temple University Fox School of Business ‘17, Course Hero Intern

  • Left Quote Icon

    I cannot even describe how much Course Hero helped me this summer. It’s truly become something I can always rely on and help me. In the end, I was not only able to survive summer classes, but I was able to thrive thanks to Course Hero.

    Student Picture

    Dana University of Pennsylvania ‘17, Course Hero Intern

  • Left Quote Icon

    The ability to access any university’s resources through Course Hero proved invaluable in my case. I was behind on Tulane coursework and actually used UCLA’s materials to help me move forward and get everything together on time.

    Student Picture

    Jill Tulane University ‘16, Course Hero Intern