CPDS Unit 1 QB
CPDS Unit 1 QB
while do while
In the while loop the condition is first In the do…while loop first the statement is
executed. executed and then the condition is
checked.
If the condition is true, then it executes the The do…while loop will execute at least
body of the loop. When the condition is one time even though the condition is false
false it comes of the loop. at the very first time.
Interpreter Compiler
Translates program one statement at a time. Scans the entire program and translates it as a whole
into machine code.
Interpreters usually take less amount of time to Compilers usually take a large amount of time to
analyze the source code. analyze the source code.
However, the overall execution time is However, the overall execution time is comparatively
comparatively slower than compilers. faster than interpreters.
No Object Code is generated, hence are memory Generates Object Code which further requires
efficient. linking, hence requires more memory.
Programming languages like JavaScript, Python, Programming languages like C, C++, Java use
Ruby use interpreters. compilers.
PART-B
1. Illustrate the different conditional statements available in C with syntax and examples
2. Explain the looping statements with neat examples.
3. What is an Array? Explain Single and Multi-Dimensional arrays with neat examples.
4. Write a C program for Matrix Multiplication with a 3*3 matrix.
5. Create a C program for Matrix Addition.
6. Write a C program to calculate the total, average and grade for 50 Students.
7. Write a C program to calculate the factorial of a given number.
8. Write a C program to check whether a given number is odd or even.
9. Write a C program to check whether a given number is prime or not.
10. Write a C program to check whether a given number is a palindrome or not.
11. Write a C program to check whether a given number is a Armstrong number or not