UNIT I C PROGRAMMING FUNDAMENTAL2
UNIT I C PROGRAMMING FUNDAMENTAL2
PART A
1. Define programming paradigm.
Programming paradigm is a style or way of programming. The are procedural,
functional,
object-oriented, logic programming.
Some of the programming languages are
Fortran
Cobol
Basic
Pascal
C
Bitwise operators
Special operators (sizeof, & and * , . and -->)
14. Recommend the suitable example for infinite loop using while.
#include<stdio.h> void main()
{
int i = 1;
while( i<10 )
{
printf(“%d\n”,i);
}
getch( );
}
Here we are not updating the value of i. so after each iteration value of i remains
same. As
a result, the condition (i<10) will always true so it will print infinity loop.
Example:
void recursion()
{
recursion(); /* function calls itself */
}
int main()
{
recursion();
PART B
1. List the different data types available in C.
2. Explain the different types of operators available in C.
3. Explain about various decision making statements available in C with illustrative
programs
4. Write a C program to print the Fibonacci series of a given number.
5. Explain in detail about functions & Function prototypes?
PART C
1. Explain in detail about Recursion with its example
2. Tower of Hanoi with sample program?
3. What is an array? Discuss how to initialize a one dimensional and two
dimensional arrays