BCA Computer Concept & C Programming SEMESTER -1 St Assignment

November 27, 2017 | Author: manoj_yadav_1 | Category: Matrix (Mathematics), C (Programming Language), Control Flow, Input/Output, Dimension
Share Embed Donate


Short Description

Complete assingment of BCA 1st Semester session 2009 And the Center Code is 02005 Assingment -1 Note: For opening fi...

Description

BCA -SEMESTER 1 c

COMPUTER CONCEPT ~ C PROGRAMMING cccc

1.c Ques: What is the difference between declaration and initialization? Explain with example.cc c  c  c c cc ccc c

 cM  cc c  c  c cc ccccc c

 c c c

 c   c  cc c cc ccc cc  c  cc  cc  cccc c c ccc c  ccc  c !c  ccc c cc  ccc  " c  c cc   cccc cc M   ccc c cc  ccc cc  cc c #$%cc c c ccccc c  cc$%cc  " c !cc

c$cc

c

c &'c  c#c cc ( c c c c c c " c c c  c !cc  cc#c$c c c#c&'c  cc#c cc

D. Ques: What is conditional operator? using conditional operator find a smallest number among two numbers.

Ans: The Conditional operator V c cccccc ccc cc c c  cc ccc

6  c6 6 

! c6 6 "cc6 #cc  $cc V ccc % c c c6   cc $cc c&c'c c c  c6 "c ccc c ccc c $c(c6  c 'c 6  ccc cc c ccc c $c)c'c c  c c  cc ** cc "** cc + cc (c  c'cc cc c ccc$cV  ccc c c c$$$, c  c c cc

c +cc  cc  cc #cc

[. Ques: What are the commonly used input/output functions in C? How are they accessed.

Ans:c Àc c  c  c  c  c c  c  c   c  c  c  c   c c  c  c)*+c c c c -c  c c cc c *c   !cc  c*'c c*'c  c*'c c*'c c*c,c c*cc  c*'c c*'c  c*'c c*'c c*c c c*cc c

  c c c   c cc-  c  cc cc cc   c. c c c c c  c c c c*c c c*cc c.c  ccc c.c  c  c  c*c c c*cc c.c c c  c-  c  c c  c  c  c c c   c c.c c%c c c%c  cc cc  c   c  c*'c c*'c c*c c c*c  cc c c c

 cc

-  c  c cc c.  cc c c  c c cc  cc

A

  

         cc

c- cc   c  cc   c c c c  c c c  cc   ccc c c c cc!/cc c 0 cc   cc "cc c   cc #c 1 ccc c   cc

V cÚ  cc - c   c. cc  c c c.ccc c c. c cc   c.  c c c   c c2 c2c  !cc )3c +cc

c#c cc 4 cc c 5c2 .c ccc.c cc c c c. c  c c c cc c cc  c'cc c  cc$cc

,c.ccc c cccccc /cc0c $ c3c cccc 1cc c cc cVcc c c2'c,c cc cc0c*c-3c %c  c cc cccc3-cc cc4c c-3c(cc cc cccc $c3c-c cV c cc c2cc5'c cc 6cc

V cÚ  cc ( cc   c  c c  c  cc  c   c c c 7c.  c ccc cc c  c c c c8c c c !cc ) c3c%+cc cc  cc cc  c9cc  )7 5c c: 7+cc c#c%cc

c

Nesting of Ú c  cc

( c c cc cc c c c $c)c c'c ccc c c cc%cc ccc c c  c $c)c'c c cc cccc  c c c  c6cc c c c %c'c  ccccc  c c cc c %c 'ccc cc  c c cc  c %c cc

Example: +c*cc 1cc c+c*cc c7  $5 cc c

 cc

  $5 cc

c 6 cc  cc

>

1cc

>

+c*cc

>

7c  $c5c cc

>

 cc

>

8cc

  $c5 cc

! cc ccc ccc c c 'c cccccc c c c1c8'c c  'cc%ccc ccccc cc  c  c  cc  c c c  c  c$c( c cccccc c c 'c c c  'cc%c ccccc  $c! cc c9c ccc%c  cc cccc cc c  'cc cc  cc cc cc cc  c c c6cc c c $cV 'cc c cc%c c c cc c $cc

l. Ques: Explain with general syntax the switch statement. Ans: The switch statement V cswitch case  ccc  cccif  c ccccc cc cc cc c c ccc c cc'c  c c ccccchar). V c ccc cswitch case  cc $cV c cc ccccswitch  ccc cc c cc c  'cc

ccc  c ccc c'c cc cc c cc c$cc

>

 cc0+cc1c

c

 c  :cc

cccc0+cc  :c % cc  c :cc

cccc0+cc :c % cc

cc

cccc0+c cc6c cc ccc c  cc % cc

8cc

ƒ. Ques: Write a recursive program to solve Towers of Hanoi problem. Ans: c /0 $ +c cc 1cc c; c
View more...

Comments

Copyright ©2017 KUPDF Inc.
SUPPORT KUPDF