GTU Questions Computer Programming & Utilization Chief Course Coordinator Prof. Mitul K.Patel (Head of Department & Assistant Professor) Course Coordinator Prof. Vrutti D. Shah (Assistant Professor) Lab Coordinators Prof. Vrutti D.Shah (Assistant Professor) Prof. Vaibhav Patel(Lecturer) Prof. Disha T Goradia (Lecturer) Mr. Dharmendra Singh (Lecturer) Academic Year 2013-2014 Shree Swami AtmanandSaraswati Institute of Technology Shree Swami Atmanand VidyaSankul, Kapodra, Varachha Road, Surat 395006 www.ssasit.org
Chapter-1 Introduction to computer and programming 1. Draw the Block diagram of Computer System and explain. 2. Explain the following terms in brief: Operating System, Compiler, Global Variable, Header Files 3. Explain various symbols used in Flowchart and draw the flowchart for finding Factorial of a number given by user. 1. What is software? List the various categories of software and their use. 2. What is flowchart? Draw a flowchart to print first N Fibonacci numbers. 3. Differentiate between compiler and interpreter. 4. Explain the C Development life cycle using flowchart in detail. 5. Draw a flowchart to count odd numbers and making their total from given N numbers. 6. What is Algorithm? 7. Explain various symbols used in Flowchart and draw the flowchart for finding smallest number out of three given numbers. 8. Draw the Block diagram of Computer System and explain. 9. Define: Software, Hardware, Higher level Language, Operating System. 10. Draw a flow chart to find factorial of a given number. 11. Name the major components of computer and give their function in brief.
Chapter-2 Fundamentals of C 1. Explain the primary data types used in C. 2. Explain various operators used in C language. 1. Explain the?: (ternary) and sizeof operators with proper examples. 2. What are the logical operators in C? List and explain them. 3. What do you mean by local and global variables? Give their scope and life time and compare them. 4. What are tri-graph characters? How are they useful? Explain any five of them 5. Explain the classification of operators in C in brief. 6. What is type conversion? Explain the type conversions supported by C Language. 7. Justify, C is middle level language. 8. Explain printf() and scanf() giving their syntex. 9. Explain switch case statement. 10. Explain various operators used in C language. 11. Data types in C. 12. Scope and Lifetime of Variable. 13. Explain implicit type conversion and explicit type conversion withexample. 14. Explain different operators used in C language. 15. Give the meaning and output of following C statements. a. x = 1,2,3; b. a = (b = 4, c = 5, b+c); c. if( x = 5) printf( x is even\ ); else printf( x is odd\n ); 16. Provide two major differences between a. Software and Hardware b. Flowchart and Algorithm 17. Write an algorithm and draw the flowchart to accept N numbers and count how many of them where odd and also compute sum of all these odd. 18. Explain the various I/O function with example in C.
19. Explain in brief the features of C language. 20. Explain logical operator and relational operator used in C language. 21. Draw a flow chart to find the smallest number out of three given numbers 22. Write a program to convert temperature entered by user from Fahrenheit into Celsius. 23. Explain the different data types of C language.
Chapter-3 Control Structures in C 1. Explain switch case statement with brief example. 2. Explain the difference between while and do..while statement. 3. Write a program to display following pattern using nested for loops. 1 1 3 1 3 5 1 3 5 7 For n lines. 4. Write a C program to check whether the given number is Prime or not. 5. Write short notes on following: (i) Nested if..else statement. (ii) Use of break and continue statement. 1. Explain the multiple (ladder) if-else with syntax and proper example. 2. Assume that you want to make the sum of 1 to 100. Give the necessary code to perform the same using (1) For loop (2) While loop (3) Do-while loop. 3. Explain the use of break and continue statement with example. 4. Write the basic differences between the while loop and do-while loop with suitable example. 5. How can you define infinite loop using while? 6. What is looping? Explain different types of loops in C and compare them. 7. Show how to sum 1 to 10 using each of these loops. 8. Write a program in C to generate Fibonacci series like following: 9. 1, 1, 2, 3, 5, 8, 13 10. Generate 20 such numbers. 11. Write a program to display following pattern using nested for loops. * * * * * * * * * * 12. Write a program to accept three number from user and print maximum number. 13. Explain if else if..ladder with flowchart. 14. Explain for loop. Differentiate use of continue, break and go to statement.
15. Write a program to print following pattern using loop statement for n row. 1 1 3 1 3 5 1 3 5 7 16. Explain operator precedence and associativity. 17. What is infinite loop in C? How can you create it? Give an example of situation where you need to use infinite loop? 18. Write a C program to display the following triangle for N lines. 1 A B 1 2 3 A B C D 1 2 3 4 5 19. Write a C program to display the following triangle for N lines. 1 A B 2 3 4 C D E F 5 6 7 8 9 20. Explain if else if ladder of C with neat diagram and a brief program code 21. Compare for loop and while loop with illustration. 22. Write a program to generate Fibonacci series of numbers (total 20 numbers) 23. Write a C Program to check whether the given number is prime or not.
Chapter-4 Array & String 1. What is String? Explain any four string handling functions in C. 2. Write a C program to read 10 numbers from user and store them in an Array. Display Sum, Minimum and Average of the numbers. 3. Write a C program to Multiply two 3 X 3 Matrix. Read Two matrices from the user. 1. Write a program to find the minimum value from the array of 3x3 2. Write a program which accepts a long string and print only characters at positions which are multiple of 3. 3. Explain the storage class specifiers in C. 4. Explain getchar() and gets() functions with suitable example. 5. Explain putchar() and puts() functions with suitable example. 6. List the advantages and limitations of Array in C. 7. Define an array of 10 integer pointers. 8. Write a C program to accept a string and print every third character from string only if it is lower case. 9. Define an array of structure with integer, string and float as members. Size of array is 10. 10. Write a program to find maximum element from 3 3 metrics. 11. Explain how string is defined in C. Write user defined functions for the following: (i) strlen() : to find length of string. (ii) strcat() : to concate two strings. 12. Write a C program to Add two 3 X 3 Matrix. 13. Write a C program to read 10 numbers from user and find Sum, Maximum andaverage of them. 14. Write a program which declares array of 10 integers, enter the data and small the elements which are even. Also find the maximum number from them. 15. Explain strcat( ), strcpy( ),strncmp( ) and strstr( ) string manipulation function. 16. Write a C program to reverse a string given from keyboard. Don t use library function to reverse it. 17. Write a C program to accept array of N integers and find the largest odd number as well as largest even number and display them.
18. What is a string? How string is stored in C? Give the various functions with their use for string processing. 19. Write a program to store 10 numbers in an array. Then find out Sum, Maximum andaverage of these 10 numbers. 20. Explain following string manipulation functions. strcmp(), strlen(), strcat(), strstr() ;
Chapter-5 Functions 1. Write a short note on Categories of Functions. 1. What is function? Explain the function definition, function prototype and function call with example. 2. What is call by value? Clear it with example. 3. Write a function which accepts a string and returns the length of the string. 4. Write a C program in which a 5 digit positive integer is entered throughkeyboard; write a function to calculate the sum of digits of the 5 digit numberwith using recursion. 5. Explain the various types of function calls in C. 6. Give a prototype of function accepting an integer pointer and a float as arguments and returns nothing. 7. Write a C function to exchange two numbers and use it to reverse an arrayof 10 integers accepted from user. 8. What is recursion? Explain it with suitable example. 9. What is used defined function? Explain types of functions with example. 10. Write a function which receives number as argument and return sum ofdigit of that number. 11. Which are various categories of functions? Explain any one with example. 12. List out the categories of functions of C. Explain any one category with example.
Chapter-6 Pointers 1. What is Pointer in C? Explain its advantages. Also write a function to do swapping of two elements using pointer. Call this function in main(). 1. What is pointer? Clear it with examples and give its use. 2. Show the use of the malloc() function. 3. Explain Dynamic Memory Allocation functions with syntax. 4. Give the meaning of a. int (*f)(int,int) ; b. int *f(int,int); 5. How can you allocate memory dynamically for 10 floating point numbers? 6. Write short note on Pointer. 7. What is dynamic memory allocation? What is difference between malloc and calloc? 8. What is a pointer? Write a program using pointer to read in an array of integers and print its elements in reverse order. 9. Explain the following with proper syntax and examples. 10. Pointers in C 2. Call by value Vs. Call by reference 11. What is pointer? Give its benefits. Write a program to do swapping of two elementsusing function with two pointers as arguments.
Chapter-7 Structure and Union 1. What is structure in C? Define a structure named Student with roll_no, name and percentage as members. Read data of 5 students from user and display them in proper format. 12. Define the union. 13. What is structure? Define the structure and explain how to access the structure members. 14. Differentiate Structures and Unions with example. 15. Explain the various ways to access the structure members with proper syntaxin C language. 16. What is structure? How can we access structure members? Clear use of nested structure using example. Compare structure with union. 17. What is structure? Explain with example how to declare a structure and how toinitialize it. 18. State difference between Structure and Union. 19. State the difference between Structure and Union. 20. What is structure? How do we declare and access structure variables?
Chapter-8 File 1. Write short notes on File Operations in C. 1. What is file management? List the different file management functions and explain the various file modes. 2. Write a program to display the contents of a given file. 3. List the various in-built string functions. 4. Write short notes on following. (i) File Operations in C. `