{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}

# BIL104E_w2 - BIL104E INTRODUCTION TO SCIENTIFIC AND...

This preview shows pages 1–8. Sign up to view the full content.

BIL104E INTRODUCTION TO SCIENTIFIC AND ENGINEERING COMPUTING (C) WEEK - 2

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

View Full Document
Operators Arithmetic Operators +, - , / , * , % , ++ , -- Relational Operators <,>,<=,>=,==,!= Logical Operators !,&&,||
Operators Assigment Operators ++ ++a : Increment a by 1, then use the new value of a in the expression in which a resides. ++ a++ : Use the current value of a in the expression in which a resides, then increment a by 1. -- -- b : Decrement b by 1, then use the new value of b in the expression which b resides. -- b -- : Use the current value of b in the expression in which b resides, then decrement b by 1.

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

View Full Document
If / If-else if ( condition 1 ) { instraction 1 } else if ( condition 2 ) { instraction 2 } . . . else if ( condition n ) { instraction n } else { instraction n }
If / If-else #include <stdio.h> main() { float a; printf("Please enter the value of angle which is between 0.0 and 180.0\n"); scanf("%f",&a); if((a<0.0)||(a>180.0)) printf("The value of the angle is not between 0.0 and 180.0 \n Program quits \n"); if((a>=0.0)&&(a<=180.0)){ if(a<90.0) printf("The angle that you entered is acute angle \n"); else if(a==90.0) printf("The angle that you entered is right angle \n"); else printf("The angle that you entered is obtuse angle \n"); } return 0; }

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

View Full Document
While Statement while ( condition ) { instactions }
While Statement Write a program for sum operation; n is entered from keyboard.

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

View Full Document
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}

### Page1 / 14

BIL104E_w2 - BIL104E INTRODUCTION TO SCIENTIFIC AND...

This preview shows document pages 1 - 8. Sign up to view the full document.

View Full Document
Ask a homework question - tutors are online