Here are question based on pointers and file handling .. And after solving these questions your all the doubts will be clear related to this topic. So these questions carefully.
Here are some sample questions for downloading full pdf of the questions click on the link.
C Programs based on pointers:-
1.Write a program to print the address of a variable whose value is input from user.
2.Write a program to print the address of the pointer to a variable whose value is input from user.
3.Write a program to print the value of the address of the pointer to a variable whose value is input from user.
4.Write a program to print a number which is entered from keyboard using pointer.
5.Write a function which will take pointer and display the number on screen. Take number from user and print it on screen using that function.
C Programs based on File Handling:-
1. Write a program in C to create and store information in a text file
2. Write a program in C to read an existing file
3. Write a program in C to write multiple lines in a text file.
4. Write a program in C to read the file and store the lines into an array
5. Write a program in C to Find the Number of Lines in a Text File
MCQs based on pointers:-
1. "&" is called as ___________ in pointer concept.
a.Conditional Operator
b.Logical Operator
c.Address Operator
d.None of these
2. "*" is called as ___________.
a.Address Operator
b.Value at Operator
c.Scope Resolution Operator
d.None of these
3.What is the output of the program ?
#include<stdio.h>
int main()
{
int a[5] = {2, 3};
printf("%d, %d, %d\n", a[2], a[3], a[4]);
return 0;
}
a.Garbage Values
b.2, 3, 3
c.3, 2, 2
d.0, 0, 0
4.What is (void*)0?
a.Representation of NULL pointer
b.Representation of void pointer
c.Error
d.None of above
5.Can you combine the following two statements into one?
char *p;
p = (char*) malloc(100);
a.char p = *malloc(100);
b.char *p = (char) malloc(100);
c.char *p = (char*)malloc(100);
d.char *p = (char *)(malloc*)(100);
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
4) Practice questions based on pointer and file handling
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