SPL Chapter 2 Exercises - DD
SPL Chapter 2 Exercises - DD
printf "%s"
\n
printf scanf
printf
//
\n printf
number NuMbEr
printf
&
%
* / % + -
printf
number int 0
:
a
number 7 "number is not equal to 7 "
"This is a C program."
"This is a C program." C
"This is a C program."
"This is a C program."
x int 0
y int 0
z int 0
x y z
result
x y z result
"The product is" int result
main { } printf
scanf %d if
printf
printf
scanf
* / %
+ -
printf \n
int number = 0;
printf("%s", "Enter an integer: ");
scanf("%d", &a);
if (number != 7) {
puts("The variable number is not equal to 7.");
}
puts("This is a C program.");
puts("This is a C\nprogram.");
puts("This\nis\na\nC\nprogram.");
puts("This\tis\ta\tC\tprogram.");
int main(void) {
printf("Enter three integers: "); // prompt
int x = 0;
int y = 0;
int z = 0;
scanf("%d%d%d", &x, &y, &z); // read three integers
if
puts if
=> >=
scanf("d", value);
printf("The product of %d and %d is %d"\n, x, y);
firstNumber + secondNumber = sumOfNumbers
if (number => largest) {
largest == number;
}
*/ Program to determine the largest of three integers /*
Scanf("%d", anInteger);
printf("Remainder of %d divided by %d is\n", x, y, x % y);
if (x = y); {
printf(%d is equal to %d\n", x, y);
}
print("The sum is %d\n," x + y);
Printf("The value you entered is: %d\n, &value);
_under_bar_ m928134 t5
j7 her_sales his_account_total a b c z z2
printf("a = 5;");
3g 87 67h2 h22 2h
x=2 y=3
printf("%d", x);
printf("%d", x + x);
printf("%s", "x=");
printf("x=%d", x);
printf("%d = %d", x + y, y + x);
z = x + y;
scanf("%d%d", &x, &y);
// printf("x + y = %d", x + y);
printf("%s", "\n");
y = a * x * x * x + 7;
y = a * x * x * (x + 7);
y = (a * x) * x * (x + 7);
y = (a * x) * x * x + 7;
y = a * (x * x * x) + 7;
y = a * x * (x * x + 7);
x
x = 7 + 3 * 6 / 2 - 1;
x = 2 % 2 + 2 * 2 - 2 / 2;
x = (3 * 9 * (3 + (9 * 3 / (3))));
printf
printf
printf
is larger
These numbers are equal
if
if
printf
%f
printf("%s", "*\n**\n***\n****\n*****\n");
int
printf("%d", 'A');
A B C a b c 0 1 2 $ * + /
42139,
4 2 1 3 9
http://bit.ly/
AHATargetHeartRates
if