Tag Archives: 10m

Why C is called a middle level language? Give a flowchart to explain the program execution process. Explain each step in detail. 10m Jun 2010

Why C is called a middle level language? Give a flowchart to explain the program execution process. Explain each step in detail. 10   C is called a middle level language It is actually binding the gap between a machine-level language and high-level language. User can use C language to do System Programming (For writing… Read More »

Explain fscanf ( ) statements with an example. 10m Dec 2009

Explain fprintf ( ) and fscanf ( )statements with an example of each. 10m Dec 2009 fscanf() Declaration int fscanf ( FILE * stream, const char * format, … ); Description Read formatted data from stream Reads data from the stream and stores them according to the parameter format into the locations pointed by the additional arguments. The additional… Read More »

What is pointer variable? How its declared? How its address is determined? How pointer can be used to pass an entire array to a function in C? 10m Dec 2009

What is pointer variable? How is a pointer variable declared? How is the address of a pointer variable determined? How pointer can be used to pass an entire array to a function in C? Explain with the help of an example. 10 An ordinary variable is a location in memory that can hold a value.… Read More »

List and explain bitwise operators in ‘C’. 10m jun2009

List and explain bitwise operators in ‘C’. 10m The following table lists the Bitwise operators supported by C. Assume variable ‘A’ holds 60 and variable ‘B’ holds 13, then – Operator Description Example & Binary AND Operator copies a bit to the result if it exists in both operands. (A & B) = 12 i.e.,… Read More »

Write a Program in ‘C’ to copy one file to another. The program should read the filenames at command line. 10m Jun2009

Write a Program in ‘C’ to copy one file to another. The program should read the filenames at command line. 10m Jun2009 Code: #include<stdio.h> int main(int argc,char *argv[]) { FILE *fs,*ft; int ch; if(argc!=3) { printf(“Invalide numbers of arguments.”); return 1; } fs=fopen(argv[1],”r”); if(fs==NULL) { printf(“Can’t find the source file.”); return 1; } ft=fopen(argv[2],”w”); if(ft==NULL)… Read More »

Write a Program in ‘C’ to print the following output ‘n’ rows. 10m june2009

Write a Program in ‘C’ to print the following output ‘n’ rows. For example, if n=3, the following should be output by the program: 10m june2009   #include <stdio.h> void main() { int I,J,N=3,K=0,ODD=1,SPACE; clrscr(); SPACE=N; for(I=1;I<=N;I++) { for(J=1;J<SPACE;J++) { printf(” “); } K=0; for(J=1;J<=ODD;J++) { if(J<=I) { K++; } else { K–; } printf(“%d… Read More »

Write a program that does not use the inbuilt string function to concatenate two strings 10m Jun2009

Write a program that does not use the inbuilt string function to perform the following: 10m Jun2009 (ii) To concatenate two strings Code:- #include<stdio.h> void main() { void str_concat(char*,char*,char*); char Str1[50],Str2[50],Str3[100]; clrscr(); printf(“\nENTER FIRST STRING TO CONCATE : “); scanf(“%s”,&Str1); printf(“\nENTER SECOND STRING TO CONCATE : “); scanf(“%s”,&Str2); str_concat(Str1,Str2,Str3); printf(“\nSTR1 IS : %s”,Str1); printf(“\nSTR2 IS :… Read More »

When can two matrices of order m x n and p x q be multiptied? Also write a program in ‘C’ to multiply two such matrices. 10m Dec2008

When can two matrices of order m x n and p x q be multiptied? Also write a program in ‘C’ to multiply two such matrices. 10m Dec2008   The only condition which makes matrix multiplication possible is n should be equal to p (i.e. n==p) n of m x n Matrix and p of… Read More »

Draw a corresponding flow chart to find the factorial of a given number using recursion. 10m Dec2008

1. (a) Design an algorithm, draw a corresponding flow chart and write a program in ‘C’, to find the factorial of a given number using recursion. 10m Dec2008   Flowchart: Code: #include<stdio.h> void main() { int factorial(); int FACT,NUM; clrscr(); printf(“ENTER NUMBER : “); scanf(“%d”,&NUM); if(NUM>0) { FACT=factorial(NUM); printf(“\nFACTORIAL OF GIVEN NUMBER IS %d “,FACT);… Read More »

A computer has 32 words RAM with a word size of 16 bits and a cache memory of 4 Blocks with block size of 16 bits. 10m Dec2007

Assume a computer has 32 words RAM each having a word of 16 bits and a cache memory of 4 blocks, with each block having 16 bits. Where can we find a main memory address 21 in the cache (if it exists) if (i) Set associative mapping is used? (ii) Direct mapping is used? (iii)… Read More »