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

Popular posts from this blog

Slip 11: Write node js application that transfer a file as an attachment on web and enables browser to prompt the user to download file using express js.

Slip 7 Create a node js file named main.js for event-driven application. There should be a main loop that listens for events, and then triggers a callback function when one of those events is detected.

Slip 1(a) Write an Angular 13 application addition of two numbers using ng-init, ng-model & ng-bind. And also demonstrate ng-show, ng-disabled, ng-click directives on button component.