0% found this document useful (0 votes)
23 views8 pages

SPL Chapter 2 Exercises - DD

SPL Chapter 2 Exercises - DD

Uploaded by

Al mamun
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
23 views8 pages

SPL Chapter 2 Exercises - DD

SPL Chapter 2 Exercises - DD

Uploaded by

Al mamun
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 8

printf

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

printf("The value is %d\n", &number);


scanf("%d%d", &number1, number2);
if (c < 7);{
puts("C is less than 7");
}
if (c => 7) {
puts("C is greater than or equal to 7");
}

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.");

// Calculate the product of three integers


printf("%s", "Enter three integers: ");
int x;
int y;
int z;
scanf("%d%d%d", &x, &y, &z);
int result = x * y * z;
printf("The product is %d\n", result);

// Calculate the product of three integers


#include <stdio.h>

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

int result = x * y * z; // multiply values


printf("The product is %d\n", result); // display result
} // end function main
&number
&
number2
number2 &number2

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);

Enter two numbers


b c a
int a b c

_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");

scanf("%d%d%d%d%d", &b, &c, &d, &e, &f);


p = i + j + k + 7;
printf("%s", "Values are replaced");
printf("%s", "a = 5");
,

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

Enter three different integers: 13 27 14


Sum is 54
Average is 18
Product is 4914
Smallest is 13
Largest is 27

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

number square cube


0 0 0
1 1 1
2 4 8
3 9 27
4 16 64
5 25 125
6 36 216
7 49 343
8 64 512
9 81 729
10 100 1000

http://bit.ly/
AHATargetHeartRates
if

You might also like