Tag Archives: Jun2008

Simplify the following Boolean function in SOP form using K-Map: F (A, B, C, D) = Σ ( 0,1, 2, 4, 6, 8, 9, 12, 14, 15 ). Draw logic circuit diagram. 8m Jun2008

Simplify the following Boolean function in SOP form using K-Map: F (A, B, C, D) = Σ ( 0,1, 2, 4, 6, 8, 9, 12, 14, 15 ). Also, draw the simplified logic circuit diagram. 8m Jun2008  K-Map for F is: Thus, the simplified equations for F (A, B, C, D) = Σ (0,1, 2, 4, 6,… 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 »

Differences between structure and union in C programming with example

What are the differences between structure and union? Give one illustrative example of usage of the union. 8m Jun2008 Structure in C programming Structure is commonly referred to as a user-defined data type. C’s structures allow you to store multiple variables of any type in one place (the structure). A structure can contain any of… Read More »