C Assignment 2,3,4 Questions
C Assignment 2,3,4 Questions
3. Explain The various modes which are used in fopen() function with suitable
Examples.
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.
8. What is a string?
9. Define Macro
#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 ”.
Example
i) free()
ii. realloc()
iii) ftell()
17.Write a C program to accept Filename from user and display its content.
20 Define preprocessor
Int main()
{Char str[20]
= “Hello”;
Char *const
P=str;
*p=’M’;
Printf(“%s\n”,Str);
Return 0;
Int main()
Int a[] = { 1, 2, 3, 4, 5} ;
Int *ptr;
Ptr = a;
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
32. Write a C Program to accept two strings from user and concatenate strings.
35 Explain various modes which are used in Fopen() function with suitable examples.
Structure.
Numbers from a file and write even and odd numbers in separate files
39 Explain Structure in C.
Example.
i)fprintf()
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
Assignemnt 4
54. State True / False: “All command Line arguments are stored as strings”.
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.
67. Write a C program to accept two Numbers from user and swap two numbers using
pointers and function.