Basic of Computer and Programming I
Basic of Computer and Programming I
4. a. What are the final values of x, y, z , p and q after the execution of the 7
following statements? [7.5]
int x = 3, y = 1, z = 2, p, q;
p = x++ - ++y + z-- ;
q=x++ + -- p
q = ++p;
1
q %= (x-y)/2;
b. Trace the program and find the output : [7.5]
8
main()
{
int i = 1 , k = 4 ;
while ( i < 10)
{
i++;
if ( i % 5 = = 0)
k += i;
else
k - = 3;
printf(\n k = %d”,k );
}
printf(\n\n i = %d”, i);
}
5. a. Why NAND gate is called universal gate? Explain by realizing into 8
AND, OR & NOT gates.
OR
How does a C program execute in C Compiler? Define the stages of
source code execution with help of diagram. 7
b. What are the algorithms and flow chart? Illustrate them by flow chart 8
and an algorithm to identify the user given number is palindrome or
not.
OR
Write flowchart and then a program to read seven days temperatures then 7
compute the average, minimum and maximum temperature.
6. a. What are the basic data types in C programming language? Describe 7
the data types with their memory size and example.
b. Write a menu based program to display: [15]
i. Print first 10 odd numbers 8
ii. Testing a number 3 digits a number is Armstrong or not
iii. Printing multiplication table of user’s number n.
iv. Exit from program.
And perform task as per user’s choice number.
7. Writer Short note (Any Two) 2×5
a) Napier's Bones
b) Nested loop
c) Macros