CE143_Assignment_17_Questions
CE143_Assignment_17_Questions
Instructions:
• Write an assignment in notebook pages, scan the pages sequentially and generate the single
pdf to upload.
• The assignment will be evaluated in terms of uniqueness, quality of answers, knowledge
and timely submission of the assignment before deadline.
• Deadline: 19/12/2020
Assignment-1
1) List out advantages of Algorithm and flowchart.
2) Write an algorithm to find average of Even number between 1-50.
3) Design flow chart to create given series “0,1,1,2,3,5,8,13 “. (Fibonacci series)
4) Write an algorithm and draw a flowchart to read the marks of a student and classify
them into different grades. If the marks secured are greater than or equal to 90, the
student is awarded Grade A; if they are greater than or equal to 80 but less than 90 ,
Grade B is awarded ; if they are greater than or equal to 65 but less than 80, Grade C is
awarded; otherwise Grade D is awarded.
5) Write an algorithm and draw a flowchart to find whether a number is Perfect Number
or not.
6) Write an algorithm and draw a flowchart to calculate the parking charges of a vehicle.
Input type of a vehicle (bus, truck, car) and number of hours. Calculate the charges as
given below: truck / bus - 20 rs per hour car – 10 rs per hour scooter/bike = 5 rs per
hour.
7) Define: Debugging, Interpreter, Compiler, Keyword, Token.
8) What is different between Header file and library file? What is the purpose of header
file? Is the use of header file absolutely required?
9) Explain data type in C with appropriate example
10) Define the rules for variable and constant declaration (#define and const).
11) Explain Preprocessor directive named Macro Expansion without argument and with
argument? What do you mean by Macro Templates (Symbolic name) and Macro
Expansion (Symbolic constant)? Explain two advantages of using symbolic constant.
How do variable and symbolic name differ?
12) What is role of comments in programming language.
13) Draw and explain the basic structure of C Language.
14) C program to find largest among four numbers using ternary operator.
15) Which of the following data definition statements are illegal and why?
• int Alf, Bert=4, Cleo=4.3, Doris='D';
• char Eric=257, Eric_Again, 3rd_Eric;
• short Default, Default_Value, default, default2;
• long int, Fred=123456789;
• Float x=123.456, Y=100 e-6;
• unsigned negative = -1;
• const int three = 4, Max, Eric=0;
• unsigned float George = 1.234;
16) Given the following data declaration
statements: int Ali, John=2, Steve=3;
Assuming integers are stored in 16 bits and long integers in 32 bits, what is the value
in each variable after each of the following statements:
Ali = John * 2 + Steve /
Steve; Ali = John << 2 +
Steve;
Ali = 12 / John*Steve;
Ali = ((-1 ^ John) & 7) |
Steve; Ali = John++ +
++Steve;
17) Write C Program to convert number of days into years, weeks and
days Expected output: