Write a program and flowchart to display the following pattern: 6m Jun2008

By | August 5, 2015

Write a program and flowchart to display the following pattern: 6m Jun2008

1

2 3

4 5 6

7 8 9 1 0

11 12 13 14 15

16 17 18 19 20 21

 

Code:

#include<stdio.h>
void main()
{
int I,J,C=1;
clrscr();
printf(“Result :\n”);
for(I=0;I<6;I++)
{
printf(“\n”);
for(J=0;J<=I;J++)
{
printf(“%d “,C++);
}
printf(“\n”);
}
getch();
}

[codesyntax lang=”c”]

#include<stdio.h>
void main()
{
int I,J,C=1;
clrscr();
printf(“Result :\n”);
for(I=0;I<6;I++)
{
printf(“\n”);
for(J=0;J<=I;J++)
{
printf(“%d “,C++);
}
printf(“\n”);
}
getch();
}

[/codesyntax]

Screen Shots:

Print_Format

Print_Format_Out

 

5 (a) Write a program in C to find the difference between two matrices of size (3×3)    5

Solved program can be found on this link http://cssimplified.com/c-programming/an-interactive-c-program-to-add-two-matrices-or-subtract-two-matrices

 

(b) Write a program in C to sort a given list of numbers using bubble sort. Draw corresponding flowchart also. 7

Solved program can be found on this link http://cssimplified.com/c-programming/draw-a-flow-chart-and-write-a-program-in-c-to-sort-a-given-list-of-numbers-7m-jun2007

 

 

(c) Explain meaning of following prototypes and mention return data type of each of them: 6

(i) int (‘f) (char*);

(ii) int *f (char*);

(iii) double f (int a, int b, char c);

(iv) unsigned f ( );

Solved program can be found on this link http://cssimplified.com/c-programming/explain-the-meaning-of-each-of-the-following-functions-prototypes-and-mention-the-return-data-type-of-each-of-them-10m-jun2006