0% found this document useful (0 votes)
5 views

C Assignment 2,3,4 Questions

Uploaded by

Raj
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
5 views

C Assignment 2,3,4 Questions

Uploaded by

Raj
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 5

Assignment 2

1. State Whether True / False: “ A string is a Sequence of characters terminated by the


character ‘\n’”.

2.What Is usages of fgetc() and fputc() functions?

3. Explain The various modes which are used in fopen() function with suitable

Examples.

4. Define union with suitable example.

5. Write a C Program to accept string From user and display its reverse.( use pointer)

6. Write A c program to create structure named books that accepts book name, price,
author.Enter values for 5 books and display it using concept of array of structure.

7. Explain malloc() and calloc() Function with example.

8. What is a string?

9. Define Macro

10. State use of fclose() function.

11. Find / Trace output of the following

#include

<stdio.h>

Int main() {

Int c = 5;

Int *p = &c;

Printf(“%d”, *p);

Return 0;

12. State True / False: “All command line arguments are stored as

String ”.

13. Declare structure with Structure Tag.


14. Explain the following function with

Example

i) free()

ii. realloc()

iii) ftell()

15. Explain command line argument with suitable Example.

16. Write a C program to count number of Characters of a string using pointer

17.Write a C program to accept Filename from user and display its content.

18.What Is random access to files? Explain fseek() with example

19Define the strcpy() of a string

20 Define preprocessor

21 State use of fgetc() function.

22 Find / Trace output of the following

Int main()

{Char str[20]

= “Hello”;

Char *const

P=str;

*p=’M’;

Printf(“%s\n”,Str);

Return 0;

23.State Use of ftell() function.

24. Define preprocessor

25. What is a pointer?

26. Find / Trace output of the following


#include<stdio.h>

Int main()

Int a[] = { 1, 2, 3, 4, 5} ;

Int *ptr;

Ptr = a;

Printf(“ %d“, *( ptr + 1) );

Return 0;

27. State whether True / False: A macro name must always be written in

Capital letter ”.

28What is a string?

Assignment 3

Assignemnt 3

29. Explain union with example in C

30. Explain the following function with example

i. strlen() ii. Strcmp() iii.strstr

31.Write A C program to find length of string using pointer

32. Write a C Program to accept two strings from user and concatenate strings.

33 Explain fseek() function with Example

34.Explain difference between Malloc() and calloc()

35 Explain various modes which are used in Fopen() function with suitable examples.

36 What are different operation Possible on pointers?


37 Write a c program to create Structure named students that accepts student name,
class, percentage. Enter values for 5 students and display it using concept of array of

Structure.

38 Write a C program to read

Numbers from a file and write even and odd numbers in separate files

39 Explain Structure in C.

40 Explain any three string handling Function with usage.

41Write a C program to reverse All elements in an array using dynamic memory


allocation. (use Pointer)

42 Write a c program to count Number of characters

43 Write a c program to copy Content of one file into another

44. Explain operation on pointers with

Example.

45. Explain the following function with Example

i)fprintf()

ii)fscanf() iii)fread() iv)fwrite()

46. Write a c program to create Structure named shops that accepts item name, quantity
and price. Enter values For 5 items and display it using concept of array of structure

47. Difference between Text file and Binary file

48. Write a C program to concatenate two Files

49. What is pointer?

50. What is a string?

51. Define union?

52. State use of ftell() function?

53. Define preprocessor.


Assignment 4

Assignemnt 4

54. State True / False: “All command Line arguments are stored as strings”.

55. Explain The fclose() function with example

56. Explain Realloc() function with example

57. Write a c program to create Structure that accepts student rollno, name, gender and
marks of 3 subjects.Find total of marks and percentage. Create an array if structure
variable to Enter information for three students.

58. Explain the various modes which are Used in fopen() function with suitable examples.

59. Explain array of structures with suitable Example.

60. What is pointer initialization?

61. Explain fwrite() with example.

62. What is random access to files?

Explain fseek() with example.

63. Explain self-referential structure.

64. How to declare union variable in C?

65. Define stream.

66. Differentiate between structure and Union.

67. Write a C program to accept two Numbers from user and swap two numbers using
pointers and function.

68. Explain fgets() function with Example

69 Write a c program to create Structure named employees that accepts emp-id,


emp_name, salary. Enter Values for 5 employee and display it using concept of array of
structure.

You might also like