Skip to main content

MATRIX

Q1Write a C program to print a "Matrix" as an output by using arrays?

#include<conio.h>                                                  
#include<stdio.h>                                                   
void main()                                                              
{                                                                              
int a[2][3],i,j;                                                            
clrscr();                                                                   
printf("Enter elements in Matrix\n");                       
for(i=0;i<2;i++)                                                       
{                                                                             
for(j=0;j<3;j++)                                                       
{                                                                              
printf("Enter elements at a[%d][%d]\t\n",i,j);           
scanf("%d",&a[i][j]);                                                
}                                                                              
}    
                                                                         
printf("\nOUTPUT\n");                                            
for(i=0;i<2;i++)                                                       
{                                                                             
for(j=0;j<3;j++)                                                       
{                                                                             
printf("%d",a[i][j]);                                                   
}                                                                             
printf("\n");                                                             
}                                                                             
getch();                                                                  
}                                                                             


***********************************************************************************


Sample Output:







Comments

Popular posts from this blog

LIST OF PROGRAMS

Practical Lab Quadratic   Bisection  False position  Newton raphson  Birgei vieta    Soln. of simultaneous linear equation   Gauss seidal method    Interpolation    Construct a diff. Table (forward /backward /divided)   Any one -  Newton Forward   Newton Backward   Newton Divided   Lagrange   Integration   Find integral value using - Simpsons ⅓  Simpsons ⅜  Statistics   Mean (AM) - any series - step deviation  Dispersion- md/sd  Correlation Coefficient  Regression lines

COMPUTER ORGANISATION

6TH SEMESTER: SECTION-A  1. Computer Organisation : Evolution of Computers, Stored program concept and Von Neumann Architecture, Information representation and codes, Combinatorial Blocks : Gates, Multiplexers, Decoders, Encoders, Sequential Building blocks : Flip-Flops, Registers, Counters, Arithmetic algorithms : Addition and subtraction for signed magnitude and 2's complement numbers, integer multiplication using shift and add, Booth's algorithms, Integer and floating point representation. SECTION-B    2. Architecture of a Simple Processor : An instruction set, Addressing Modes, Instruction formats, Instruction execution in terms of Microinstructions, Concept of interrupt and simple I/O organisation, I/O organization : Strobe-based and Handshake based communication, Vector and priority interrupts, DMA-based data transfer; CPU organisation with large registers, Stacks and handling of interrupts and subroutines. Concept of Bus, data movement among registers...