Posts

Showing posts from November, 2017

Write a C Program to Find Transpose of a Matrix.

#include<stdio.h> int main()  // main function which returns integer value {     int r, c, i, j;     //declaration of integer variables     printf(">> Enter rows and columns of matrix: ");    // print statement to get size of rows and cols     scanf("%d %d", &r, &c);     // run time initialization for 'r' and 'c'     // here we have two multi dimentional arrays of type integer.. 1) 'a' 2) 'transpose'     int a[r][c], transpose[r][c];   // declaration of array with run time size allocation.     // Storing elements of the matrix     printf("\nEnter %d elements of matrix:\n",(r*c));   // printing total elements to insert in array.     for(i=0; i<r; i++)  // for loop to iterate rows         for(j=0; j<c; j++)  // for loop t...
/** CPU Tutorial 2. Fundamentals of 'C' >> Question 1 : C Program to convert temperature from Fahrenheit to Celsius and vice versa. */ #include<stdio.h> // including standard input output library OR header void main() // starting of main function. {     float fahrenheit,celsius; // Declaration of variables with type float     int choice; // Declaration of variables with type int     printf("1: Convert temperature from Fahrenheit to Celsius."); // Simple print statements     printf("\n2: Convert temperature from Celsius to Fahrenheit.");     printf("\nEnter your choice (1, 2): ");     scanf("%d",&choice); // compile time initialization of choice variable     if(choice ==1) // if..else if conditional statement.     {         printf("\nEnter temperature in Fahrenheit: ");      ...

Registration for CPU

Loading...

Updates from practical set 6 : function programs

test