Tag Archives: 6m

Write a macro to demonstrate #define, #if, #else preprocessor commands. 6m Jun 2010

Write a macro to demonstrate #define, #if, #else preprocessor commands. 6    Code: #include <stdio.h> #define CHOICE 100 int my_int = 0; #if (CHOICE == 100) void set_my_int() { my_int = 35; } #else void set_my_int() { my_int = 27; } #endif main () { set_my_int(); clrscr(); printf(“%d\n”, my_int); getch(); } [codesyntax lang=”c”] #include <stdio.h> #define… Read More »

Write a program in ‘C’ to find a sum of square of odd numbers. 6m Jun 2010

Write a program in ‘C’ to find a sum of square of odd numbers :- 12 +32+ 52+ 72 +92+ +N2   Code:- #include<stdio.h> void main() { int NUM,i,j,SUM=0; clrscr(); printf(“\nENTER INTERGER NUMBER : “); scanf(“%d”,&NUM); for(i=1;i<NUM+1;i++) { if(i%2!=0) { SUM=SUM+(i*i); } } printf(“\nTHE SUM OF SQUARE OF ODD NOS. TILL %d NO. IS : %d”,NUM,SUM);… Read More »

Write a program and flowchart to display the following pattern: 6m Jun2008

Write a program and flowchart to display the following pattern: 6m Jun2008 1 2 3 4 5 6 7 8 9 1 0 11 12 13 14 15 16 17 18 19 20 21   Code: #include<stdio.h> void main() { int I,J,C=1; clrscr(); printf(“Result :\n”); for(I=0;I<6;I++) { printf(“\n”); for(J=0;J<=I;J++) { printf(“%d “,C++); } printf(“\n”); }… Read More »

Give a brief note on null pointer assignment. Write a program to illustrate this concept. 6m Jun2008

Give a brief note on null pointer assignment. Write a program in ‘C’ to illustrate this concept. 6m Jun2008 Null Pointer Assignment It does make sense to assign an integer value to a pointer variable. An exception is an assignment of 0, which is sometimes used to indicate some special condition. A macro is used… Read More »

Write a program to read formatted data from the file. 6m Jun2008

Write a program to read formatted data from the file. 6m Jun2008 CODE:- #include<stdio.h> void main() { int account; char name[30]; double bal; FILE *fp; if((fp=fopen(“data.txt”,”r”))== NULL) printf(“FILE not present \n”); else do{ fscanf(fp,”%d%s%lf”,&account,name,&bal); if(!feof(fp)) { if(bal==0) printf(“%d %s %lf\n”,account,name,bal); } }while(!feof(fp)); getch(); } [codesyntax lang=”c”] #include<stdio.h> void main() { int account; char name[30]; double… Read More »

Explain the basic principle of Quine-McCluskey method of simplifying the Boolean expression with the help of an example function. 6m Jun2007

Explain the basic principle of Quine-McCluskey method of simplifying the Boolean expression with the help of an example function. 6m Jun2007 Quine McKluskey Method A tabular method was suggested to deal with the increasing number of variables known as Quine McKluskey Method. This method is suitable for programming and hence provides a tool for automating… Read More »

List all the features of the RISC architecture. 6m Jun2015

List all the features of the RISC architecture. 6m Jun2007   List some important features of RISC architecture :  One instruction per cycle: A machine cycle is the time taken to fetch two operands from registers, perform the ALU operation on them and store the result in a register. Thus, RISC instruction execution takes about… Read More »

Write an 8086 assembly language program that finds the largest, and the second largest number from a list of 10 numbers stored in the memory 6m Jun2006

Write an 8086 assembly language program that finds the largest, and the second largest number from a list of 10 numbers stored in the memory 6m Jun2006 To understand program for Largest in an array in detail Please Click this link below http://cssimplified.com/computer-organisation-and-assembly-language-programming/an-assembly-program-for-finding-the-largest-number-in-array-of-10-elements DATA SEGMENT ARR DB 5,3,7,1,9,2,6,8,4 LEN DW $-ARR LARGE DB ? SECOND… Read More »

Draw the logic diagram of a full adder. Create a 2-bit adder-subtractor circuit using the block diagram of the full adder 6m Jun2006

Draw the logic diagram of a full adder. Create a 2-bit adder-subtractor circuit using the block diagram of the full adder 6m Jun2006 A combinational circuit which performs addition of two bits is called a half adder, while the combinational circuit which performs arithmetic addition of three bits (the third bit is the previous carry bit)… Read More »

Evaluate the effective address if addressing mode is Direct, Relative, Register indirect, Index with lndex register 6m Dec2005

An instruction is stored at location 500 with its address field at location 501. The address field has the value 300. A processor register R1 contains the number 100. Evaluate the effective address if the addressing mode of the instruction is   6m Dec2005                        … Read More »