Assignments 1
1) Give the use of rewind ( ) function.
2) What is dynamic memory allocation?
3) Which function is
used to join two strings? Give syntax.
4) Give the
difference between structure and union.
5) Which function is used to move file pointer?
6) What is macro?Explain the types of macros?
6) Give syntax and use of following functions:
i) strlen ii) strcat iii) strcmp iv) strcpy v) strrev
7) Define file. Explain any four file functions.
8) Explain malloc() and calloc() functions with example.
9) Write a C program to declare book structure (bookno,
bookname, author). Accept details of n books and display books of particular
author.
10) Explain the structure of C program.
9) What is the output of following C code? Justify.
1) int main ( )
{
static char name [] = “programming”;
char *s ; s = & name [6] - 4;
while (*s)
printf (“%c”, * s ++);
}
2)
What is the output of following C code? Justify.
# define Test (x) (x
* x)
int main ( )
{
int a, b = 3;
a = Test (b + 3);
printf (“% d - % d”, a, b);
}
3) struct employee
{
char ename [20];
int empno;
} el,* ptr,e[20];
int main ( )
{
printf("\n%d",sizeof(el));
printf("\n%d",sizeof(ptr));
printf("\n%d”,sizeof(el));
}
4) #include<stdio.h>
int main()
{
int a =5, b=10, c=7;
predict (a,&b,c);
printf("%d - %d - %d",a,b,c);
}
void predict(int p,int *q,int r)
{
p = 50;
*q =*q * 10;
r = 77;
}
Comments
Post a Comment