Pplassignment 1

You might also like

Download as pdf or txt
Download as pdf or txt
You are on page 1of 1

UNIVERSITY OF PETROLEUM AND ENERGY STUDIES

Assignment-1
Program Name: BT-CSE-I-45&46
Semester: I
Course Name: PPL Max. Marks: 20
Course Code: CSEG 1010 Due Date: 11th DEC, 2022

Instructions: Each question carry 5 marks.

Q1. Explain the generations of programming languages in detail.

Q2. Write an algorithm to find the roots of quadratic equation and make a flowchart of it.

Q3. Define the stages of Program Compilation with help of example.

Q4. Find the output of the following code:

a. #include <stdio.h>
int main()
{
int x;
x = 10;
if(x > 10)
x -= 10;
else if(x >= 0)
x += 00;
else if(x)
x += 10;
else
x -= 10;

printf("%d\n",x);
return 0;
}

b. #include <iostream>
using namespace std;
int main()
{
int count = 0;
for (;;) {
if (count == 10)
break;
printf("%d ", ++count);
}
return 0; }

You might also like