Solution :
int f(int x){
;
}*/
int f(
){
int stack[2] = {
};
;
;
;
R1 = R1 * C; /*R1 =
*/
;
* R2; /* R0 = bx */
; /*R0 =
*/
;
; /*R0 = a+bx+cx^2 */
}
/*
int s=0;
{
;)
*/
AREA SumSquares, code, readWrite
ENTRY
;loop
MOV r1, #0 ; s = 0
Loop
;calculate i*i
;s = s+ i*i
, #1 ; i = i+1
,#10 ; test for end
Loop ;
END
B.tablet because it is technically not a computer in traditional sence but a hand held device.
<span />
3. A, (first choice)
4. C (Third choice from top)
Answer:
For question a, it simplifies. If you re-express it in boolean algebra, you get:
(a + b) + (!a + b)
= a + !a + b
= b
So you can simplify that circuit to just:
x = 1 if b = 1
(edit: or rather, x = b)
For question b, let's try it:
(!a!b)(!b + c)
= !a!b + !a!bc
= !a!b(1 + c)
= !a!b
So that one can be simplified to
a = 0 and b = 0
I have no good means of drawing them here, but hopefully the simplification helped!
Answer:
Code is given below and output is attached as an image.
Explanation:
#include <iostream>
#include <fstream>
using namespace std;
bool isPalindrome(int n)
{
// Find reverse of n
int rev = 0;
for (int i = n; i > 0; i /= 10)
rev = rev * 10 + i % 10;
// If n and rev are same,then n is a palindrome
return (n == rev);
}
int main()
{
int min = 1; // Lower Bound
int max = 200; // Upper Bound
ofstream myfile;
myfile.open("palindrome.txt");
for (int i = min + 1; i < max; i++)
if (isPalindrome(i))
myfile << i << endl;
myfile.close();
return 0;
}