Convert The Following Pseudo Code Into C

You might also like

Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 7

Convert the following pseudo

code into C++ program


1. START
2. A <---3
3. A <---A * 12
4. B <---A % 7
5. A <---A + B
6. PRINT A, B
7. STO
Convert the following pseudo
code into C++ program
1. START
2. A <---3
3. A <---A * 12
4. B <---A % 7
5. A <---A + B
6. PRINT A, B
7. STO
Convert the following pseudo
code into C++ program
1. START
2. A <---3
3. A <---A * 12
4. B <---A % 7
5. A <---A + B
6. PRINT A, B
7. STO
Convert the following pseudo
code into C++ program
1. START
2. A <---3
3. A <---A * 12
4. B <---A % 7
5. A <---A + B
6. PRINT A, B
7. STO
Convert the following pseudo
code into C++ program
1. START
2. A <---3
3. A <---A * 12
4. B <---A % 7
5. A <---A + B
6. PRINT A, B
7. STO
Convert the following pseudo code into C++ program
1. START

2. A <---3

3. A <---A * 12

4. B <---A % 7

5. A <---A + B

6. PRINT A, B

7. STOP

2. What do you mean compiler


error describe it with example?
3. What is the purpose of C++
comments?
4. Are they the following
operators the same? How?
C++, C=C+1, C+=1
2. What do you mean compiler error describe it with example?

3. What is the purpose of C++ comments?

4. Are they the following operators the same? How?

C++, C=C+1, C+=1


5. Demonstration of prefix and
postfix increment and
decrement operators
#include <iostream.h>
int main()
{
int a = 5,b,c; // declarating
three integer variables
b=a++; // post increment
c=++a; // pre increment
cout<<”Increment operator
result\n”;
cout << "a= "<<a;
cout << "\nb= " << b;
cout << "\nc= " << c;
b=a--; // post decremen
5. Demonstration of prefix and postfix increment and decrement operators

#include <iostream.h>

int main()

int a = 5,b,c; // declarating three integer variables

b=a++; // post increment

c=++a; // pre increment

cout<<”Increment operator result\n”;

cout << "a= "<<a;

cout << "\nb= " << b;

cout << "\nc= " << c;

b=a--; // post decrement

c=--a; // pre decrement

cout<<”\n\nDecrement operator result\n”;

cout << "a= "<<a;

cout << "\nb= " << b;

cout << "\nc= " << c;

6. Write a program to swap (interchange) the values of two variables a and b without using third

variable using the Addition and Subtraction Operators.

7. Write a program in C++ to print your name on the screen.

8. Write a C++ program to display the following output?

Dear Student,

How is "C++ /_\programming " ?

You might also like