2004 Hemchandracharya North Gujarat University M Tech Automobile 103 Computer Fundamentals & Programming in C Question paper
F. Y. M. Sc. (CA & IT) Examination August - 2004 103 – Computer Fundamental & Programming in C Time : 3 Hours] [Total Marks : 35
1 Do as directed : (any two) 5 (a) Write short-note on algorithm and write an algorithm of Finding sum 1st hundred natural nos.
(b) Draw flow-chart : 1. Finding area of circle and display it. (Accept the radius) 2. Finding the length of accepted string and display it. (without using strlen( ))
(c) Write short-note on characteristics of higher level languages.
2 Do as directed : (any four) 8 (a) what will be the last value as a, b and c? int a=2, b=3, c=4; c + = + + a * b + + + a + + / b - + + c * b+ +; (b) Write output for following : main( ) { int a=100, b=200, c=300;
while (a = = 100) { if ( c>=b ) b += a; a += b; } printf(“a=%d\n", a); printf(“b=%d\n", b);
} (c) what will be output after executing following part : main ( ) { int i = 100, sumx = 100; for ( ; i<=200 ; i+<2) { Sumx = sumx + i; printf(“ sumx=%d\n", sumx); printf(“i=%d", i ); } } (d) What will be the output ? main( ) { int a=10, b=20; clrscr( ); printf(“a=%d\n b=%d\n", a, b); sweep (a, b); printf(“a=%d\n b=%d\n", a, b); } sweep (int a, int b) { int t; t=a; a=b; b=t; return; } (e) Find and display output main( ) { float a=3.230719; printf(“\n %6.2 f", a); printf(“\n %5.4 f", a); printf(“\n %2.1 f", a); printf(“\n %0.0 f", a); }
3 (a) Write a ‘C' program for finding sum as those nos between n1 5 and n2 which can be divisible by n3 with reminder zero. Accept n1,n2 and n3 from terminal. OR (a) Write ‘C' program for finding the sum of following : 5 2 1+ 3 accept n from terminal. (b) Write a ‘C' prog. Which will write the first 25 fibonacci nos. into? one file. Display these nos on terminal. OR (b) (1) Write a ‘C' prog. which display the accepted string 5 in reverse order without using any build-in library string functions. (2) Write a ‘C' prog. for sweeping two nos. without 5 using third variable. (c) Write a ‘C' prog. for addition of 3*3 matrix. Display 2 Ans matrix.
4 (a) Write short notes on any three : 6 1. Circle( ), Ellipse( ), getx( ), gety( ). 2. Switch statement 3. Basic structure of ‘C' lang. 4. Advantages of pointer.
(b) State true or false with reason. 1 In the ‘C' prog. language every line of statement must be ended by semicolon. (c) What will be the value of b? 1 int x = 100, b = 0; b = (x>=100) ? x/2 : x/3;
(d) Find and show syntax errors (if any) 2 main( ) { int x = 100; y = 20; a = 100; cls( ) printf(“%d %d", x); y = getchar( ); while (x = 100) x + +; y + = a; a** y
=====================
DC-2503 Seat No.___ First Year M. Sc. (CA. & IT) Examination March/April - 2004 Computer Fundamental & Prog. In "C" : Paper No.- 103 Time : 3 Hours] [Total Marks : 35 1 (a) Attempt any three : 9 (1) Discuss the Advantages of pointers with example. (2) List the different types of operators available in "C". Discuss Bit wise opera¬tor with example. (3) What is Recursion Function ? Discuss its advantages and disadvantages with example. (4) Explain given terms : (1) Compiler (2) # define (3) Header file. (5) Discuss the difference between while and DO..... while loop with suitable example. (b) Draw a flowchart for check given no. is 2 prime or not.
2. Attempt any two : 8 (1) Write a "C" program for Display given kind of structure using while loop, if n = 5 then 1 2 4 5 9 1 7 8 9 12 3 4567 (2) Write a program for checking given string is palindrome or not. (Note ; Do not use library function from string, h file, Make U. D. F. for string length, string compare, & Reverse string). (3) Write a program to calculate the value of sum for the following series : 1357 — - — + — - — + ............. nterms. --- --- -- -- 0! 2! 4! 6! 3. Write a program for Matrix multiplication. Read the two 5 Matrix from Input file In. dat & give the Result in output, txt. OR 3. Create a structure customer. Which contain customer no, name, Due amount. Inmain function create An array of pointer to given structure customer. Use dynamic memory assignment and input n number of customer in formation. Display given information in descending order of due amount.
4 Give output for given code : 8 (1) int a, b, c, d; a = 5; b = a/2; c = 10; print f ("value of A : B ; C -> % d : % d : % d", ++a, b++, c+ = 5); d = ++a + b- - + b- - + (++c); print f ("value of A : B : C -> % d : % d : % d \ n", a, b, c); print f ("value of D -> % d \ n", d / b); (2) int i = 1, j = 2, k = 3, Test; while (i < 5) { i ? (Test = j) : (Test = k); print f ("Test -> % d \ n", Test); while (j < 5) { while (k > 0) { i = k+ 1; k/=5; } break; } i++j; } print f ("I, J, K, Test -> % d, % d, % d, % d" i, j, k, Test);
(3) int i = 0; for (i = 1; i < = 5; i + +) { switch (i)
{ case 1 : print f (" 1"); * case 2 : print f ("2"); case3 : print f ("3"); case 4 : print f(" 4"); case 5 :printf("5\ n"); 1 } } (4) int i = 0; char Test [10], * p; p = Test; while (i < 10) { Test [i] = i +- 65; I++; } for (p+=g; i>0; p-- , j - -) print f("%c", *p);
5 Attempt any two : 3 (1) Difference between structure & Union. (2) Explain Break & Continue statement. OR 5 Discuss given graphic function with example: Initgraph ( ); out text xy ( ); draw poly ( );
Return to question paper search
|