Lec34 - Computer Programming I TA C162. To be discussed...

Info iconThis preview shows pages 1–6. Sign up to view the full content.

View Full Document Right Arrow Icon
1 Computer Programming I TA C162 . 12 Apr 2007 To be discussed today…. . User-Defined Functions Examples Functions with no arguments and no return value Functions with arguments and no return value Functions with arguments and return value Functions with no arguments but returns a value Passing Array as an argument to a function One dimensional  Two dimensional Strings
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
2 Computer Programming I TA C162 . 12 Apr 2007 Functions with no arguments and no return value void displayline(void); void main() { displayline(); sum(); } void displayline() { int j; printf(“*”); } void sum() {int a,b; printf(“Enter a and b\n”); scanf(“%d %d”,&a,&b); printf(“Sum = %d ”,(a+b)); Calling function Called functions
Background image of page 2
3 Computer Programming I TA C162 . 12 Apr 2007 Functions with arguments and no return value void displayline(char); void Sum(float, float); void main() { char ch; float a,b; printf(“Enter character to print in line\n”); scanf(“%c”,&ch); displayline(ch); printf(“Enter value of a and b\n”); scanf(“%f %f”,&a,&b); Sum(a,b); }
Background image of page 3

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
4 Computer Programming I TA C162 . 12 Apr 2007 Functions Definition void displayline(char ch) { int j; for(j=0;j<40;j++) printf(“%c”,ch); } void Sum(float x, float y) { printf(“Sum = %f ”,(x+y)); }
Background image of page 4
5 Computer Programming I TA C162 .
Background image of page 5

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Image of page 6
This is the end of the preview. Sign up to access the rest of the document.

This note was uploaded on 05/07/2010 for the course CS&IS TA C162 taught by Professor Kavitha during the Spring '09 term at Birla Institute of Technology & Science.

Page1 / 18

Lec34 - Computer Programming I TA C162. To be discussed...

This preview shows document pages 1 - 6. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online