Here are the some programs based on loops and functions .I am giving you some program for the practice topic wise .I am also giving you some MCQS questions based on these topics .So after solving these questions your doubts will be clear related to these topic.
C- Program based on function:-
1) Write a function to calculate factorial of a number.(Takes Something, Returns Something).
2) Write a function to calculate area of a circle.(Takes Something, Returns Something)
3) Write a program to print System Date.
4) Write a function to calculate sum of first N natural numbers. (all four ways: TNRN, TSRN, TNRS, TSRS).
C program based on loops:-
1) Write a program to print Your name 5 times on the screen.
2) Write a program to print first 10 natural numbers.
3) Write a program to print first 10 natural numbers in reverse order.
4) Write a program to print first N natural numbers. (N is given by user)
5) Write a program to print first N natural numbers in reverse order. (N is given by user).
MCQS :-
1) Choose a right C Statement.
A) Loops or Repetition block executes a group of statements repeatedly.
B) Loop is usually executed as long as a condition is met.
C) Loops usually take advantage of Loop Counter
D) All the above.
2) Loops in C Language are implemented using.?
A) While Block
B) For Block
C) Do While Block
D) All the above
3) Which loop is faster in C Language, for, while or Do While.?
A) for
B) while
C) do while
D) All work at same speed
4) Choose correct C while loop syntax.
A)
while(condition)
{
//statements
}
B)
{
//statements
}while(condition)
C)
while(condition);
{
//statements
}
D)
while()
{
if(condition)
{
//statements
}
}
5) Choose a correct C for loop syntax.
A)
for(initalization; condition; incrementoperation)
{
//statements
}
B)
for(declaration; condition; incrementoperation)
{
//statements
}
C)
for(declaration; incrementoperation; condition)
{
//statements
}
D)
for(initalization; condition; incrementoperation;)
{
//statements
}
Click on the given links for the questions:-
1)Practice questions based on decision control
2) Practice questions based on loops and functions
3) Practice questions based on array and string and searching , sorting
Recommended Post:
Hackerearth Problems:-
- Very Cool numbers | Hacker earth solution
- Vowel Recognition | Hackerearth practice problem solution
- Birthday party | Hacker earth solution
- Most frequent | hacker earth problem solution
- program to find symetric difference of two sets
- cost of balloons | Hacker earth problem solution
- Chacha o chacha | hacker earth problem solution
- jadu and dna | hacker earth solution
- Bricks game | hacker earth problem
- Anti-Palindrome strings | hacker earth solution
- connected components in the graph | hacker earth data structure
- odd one out || hacker earth problem solution
- Minimum addition | Hackerearth Practice problem
- The magical mountain | Hackerearth Practice problem
- The first overtake | Hackerearth Practice problem
- Playing With Characters | Hackerrank practice problem solution
- Sum and Difference of Two Numbers | hackerrank practice problem solution
- Functions in C | hackerrank practice problem solution
- Pointers in C | hackerrank practice problem solution
- Conditional Statements in C | Hackerrank practice problem solution
- For Loop in C | hackerrank practice problem solution
- Program to find cycle in the graph
- Implementation of singly link list
- Implementation of queue by using link list
- Algorithm of quick sort
- stack by using link list
- program to find preorder post order and inorder of the binary search tree
- Minimum weight of spanning tree
- Preorder, inorder and post order traversal of the tree
- How to set limit in the floating value in python
- What is boolean data type
- How to print any character without using format specifier
0 Comments