Tag Archives: function

Simplify the following Boolean function in POS form using K-maps, also draw a logic diagram using only NAND gates 5m Dec2005

 Simplify the following boolean function in POS form using K-maps : F (A, B, C, D) = Σ (0, 2, 4, 5, 6, 8, 10, 13, 15) Also draw a logic diagram using only NAND gates.         5m Dec2005    K-Map for F is: Thus, the simplified equations for F (A, B, C, D) =… Read More »

Explain how overlapped register window can be implemented for procedure calls. Explain the process of parameter passing for the subroutine call on this machine? – IGNOU MCA Assignment 2014 – 15

MASTER OF COMPUTER APPLICATIONS Course Code : MCS-012 Course Title : Computer Organisation and Assembly Language Programming Assignment Number : MCA (2)/012/Assign /2014-15 Maximum Marks : 100 Weightage : 25% Assume that a RISC machine has 64 registers out of which 16 registers are reserved for the Global variables. This machine has been designed to… Read More »

Explain the concept of a function returning a pointer with an example 6m Jun2007

Explain the concept of a function returning a pointer in C with an example 6m Jun2007 Function returning a pointer in C A function can also return a pointer to the calling program, the way it returns an int, a float or any other data type. To return a pointer, a function must explicitly mention… Read More »

Summarize the purpose of the format strings (like %s, %d, %c) that are’ commonly used within the printf function, with an example for each.10m Jun2006

Summarize the purpose of the format strings (like %s, %d, %c) that are’ commonly used within the printf function, with an example for each.10m Jun2006 If printf function format includes format specifiers (subsequences beginning with %), the additional arguments following format are formatted and inserted in the resulting string replacing their respective specifiers. It can… Read More »

What is the difference between a function and a macro? Find the largest number among two numbers using a function definition as well as a macro. Which is more efficient in terms of execution time and code size? 10m Jun2006

What is the difference between a function and a macro? Find the largest number among two numbers using a function definition as well as a macro. Which is more efficient in terms of execution time and code size? 10m Jun2006  Difference between a function and a macro:    Function Code [codesyntax lang=”c”] int MAX(X,Y) {… Read More »

Write the functions to perform the following : 10m Dec2005

Write the functions to perform the following : 10m Dec2005  To accept a string and print the rightmost “n” characters   #include<stdio.h> #include<string.h> #include<alloc.h> char *rightsub(char *,int n); void main() { char s1[20],s2[20],ch,*s; int n; clrscr(); printf(“enter the string s1:”); gets(s1); printf(“enter the no of characters to extract=”); scanf(“%d”,&n); s=rightsub(s1,n); printf(“\nright sub string: %s”,s); free(s); getch();… Read More »

Write the syntax and explain the purpose of the following function: Fprintf( ) 2m Dec2005

Write the syntax and explain the purpose of the following function: 2m Dec2005   (iii) Fprintf( ) Description The C library function int fprintf(FILE *stream, const char *format, …) sends formatted output to a stream. Declaration Following is the declaration for fprintf() function. [codesyntax lang=”c”] int fprintf(FILE *stream, const char *format, …) [/codesyntax]Parameters stream — This… Read More »

Write the syntax and explain the purpose of the following functions : Fclose() 2m Dec2005

Write the syntax and explain the purpose of the following functions : 2m Dec2005 (ii) Fclose( ) Description The C library function int fclose(FILE *stream) closes the stream. All buffers are flushed. Declaration Following is the declaration for fclose() function. [codesyntax lang=”c”] int fclose(FILE *stream) [/codesyntax]Parameters stream — This is the pointer to a FILE… Read More »

Write the syntax and explain the purpose of the following functions : Fseek() 2m Dec2005

Write the syntax and explain the purpose of the following functions : 2m Dec2005 (i) Fseek( ) Description The C library function int fseek(FILE *stream, long int offset, int whence) sets the file position of the stream to the given offset. Declaration Following is the declaration for fseek() function. [codesyntax lang=”c”] int fseek(FILE *stream, long… Read More »

Write the functions to perform the following : 10m Dec2005

Write the functions to perform the following : 10m Dec2005   (i) To find mn where m, n > 0 #include<stdio.h> void main() {  long int power(int,int);  int M,N;  long int RES;  printf(“ENTER M : “);  scanf(“%d”,&M);  printf(“ENTER N : “);  scanf(“%d”,&N);  RES=power(M,N);  printf(“\nRESULT IS %ld “,RES);  getch(); } long int power(int M,int N) {  long… Read More »