Posts

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

Practical 6 (AI)

Image
PRACTICAL NO :- 6 Aim : - Write  a  program  to  implement  Depth First Search. Program Code: domains path=symbol* predicates search(symbol,symbol,path) edge(symbol,symbol) member(symbol,path) clauses search(X,X,T). search(X,Y,T):- edge(X,Z), not(member(Z,T)), search(Z,Y,[Z|T]). member(X,[X|_]):-!. member(X,[_|Y]):- member(X,Y). edge(g,h). edge(g,d). edge(e,d). edge(h,f). edge(e,f). edge(a,e). edge(a,b). edge(b,f). edge(b,c). edge(f,c). Output:

Practical 1 (AI)

Image
PRACTICAL NO :- 1 Aim : Write a Prolog Program that list four address in a label form, each address should list a name, one-line address, city, state, and Pin Code. Program Code: predicates             reference(symbol,symbol,symbol,symbol,symbol)             goal             write("Please Enter Your Name : "),             readln(Name),             reference(Name,Address,City,State,PinCode),             write(">Name:",Name),nl,             write(">Address:",Address),nl,             write(">City:",City),nl, ...

Mobile Blogger

Just installed Blogger on my IPhone :)