assignment csp.docx
TRANSCRIPT
-
8/11/2019 Assignment CSP.docx
1/3
B Tech First Year
KIIT University, Bhubaneswar
School of Computer Engineering, Campus
15
Assignment CSP
Q1. Write the output of the following code segments:(a). int x[5]={1,2,3,4,5};
int i;for(i=0;i
-
8/11/2019 Assignment CSP.docx
2/3
Q11. WAP to check whether the given number is a power of 2 or not.
Q12. WAP to find the factorialof a number.
Q13. WAP to find the Armstrong numbers with in a given range.
Q14. WAP to find the GCD of 2 numbers.
Q15. WAP to find whether the given number is a palindrome or not.
Q16. WAP to compare 2 integer array are same or not. Incase of nonsimilar print the 1stmismatched element.
Q17. WAP to generate the fibonacci series upto the nth term.
Q18. WAP to swap 2 numbers without using a 3rdvariable.
Q19. WAP to print every fourth odd number from 1 to n, where n is user
input.
Q20. WAP to print the factors of a given number.
Q21. WAP to convert binary to decimal number.
Q22. WAP to convert decimal to hexadecimal number.
Q23. WAP to print the follwing series.(i) 1
2 3
4 5 67 8 9 10
(ii) 1
1 2 1
1 2 3 2 11 2 3 4 3 2 1
1 2 3 4 5 4 3 2 1
(iii) *******
*****
***
*
Q 24. Write notes on
(i) What is a conditional operator in c? Explain with anexample.
(ii) What is the advantage of arrays? Explain.
(iii) Explain the role of c pre-processor.
(iv) Name & Describe the basic data types in c.(v) Describe different types of operator in c.
Q 25. Differentiate:
(i) While loop and do-while loop.
(ii) Primary memory and secondary memory.
(iii) System software and application software.
-
8/11/2019 Assignment CSP.docx
3/3
B Tech First Year
KIIT University, Bhubaneswar
School of Computer Engineering, Campus
15
(iv) Linker and loader.
(v) Compiler and interpreter.
(vi) Machine Language & High level Language.
(vii) Precedence & Associativity.
(viii) Prefix & Postfix operation.
(ix) break & continue.