Computer Concept & Programming In C - Unit I - 5

Q.7. What are differences in GUI interface and CUI interface? Give one example of each to explain your answer.                                                                          (AKTU. 2010-11)
Ans. GUI or Graphical user interface is different from CUI or command line user interface or character user interface. The following is the difference between the two kind of interface. CUI is same as CUI means (Composite User Interface).
Composite User Interface combines both type of interfaces i.e. Graphical User Interface and Commond Line User Interface.



Q.8 Write and execute the first C program.
Related Questions -
Q. Explain the basic structure of a C program.                                    (AKTU. 2013-14)
Ans. The first C program: -
1. # include <stdio.h>
2. # include <conio.h>
3. void main ( )
4. {
5. clrscr ( );
6. printf (“\n welcome to C”);
7. getch ( );
8. }
The output of the above program is 
Welcome to C
Explanation: - Line 1 includes stdio.h i.e. a standard input output header file which contains function printf.
Line 2 includes <conio.h> i.e. a console input output header file which includes clrscr ( ) function and getch ( ) function.
Line 3 starts main function. In C program execution beings from main ( ).
Line 4 is opening curly bracket { which starts body of function main.
Line 5 calls clear screen function clrscr ( ) to clear the screen.
Line 6 prints the message Welcome to C on screen and come to new line due to \n because these are arguments within double quotes (“ ”) of function printf.
Line 7 calls function getch ( ) which waits until a key is pressed from keyboard.
Line 8 is closing curly bracket } which defines end of function main ( ).
To execute this program
Step 1. Type it on C editor in Turbo C++ IDE.
Step 2. Save it with name and extension . C
Step 3. Compile it                                              (Compile option on screen)
Step 4. Run it                                                     (Run option on screen)