Posts

SKC

Image
  LAB:1 a. Write a C program to print Hello World.      i. Problem Solving Logic – None  ii. Algorithm Step 1. Start the program execution.  Step 2. Include the necessary header file (stdio.h) for input and output operations.  Step 3. Declare the main function, which serves as the entry point for the program.  Step 4. Inside the main function: a) Use the printf function to print the string "Hello World" followed by a newline character (\n) to the console. b) Return 0 to indicate successful program execution.  Step 5. End the program. b. Write a C program to calculate the area of a circle i. Problem Solving Logic a) Input the radius: Prompt the user to input the radius of the circle.  b) Calculate the area: Once you have the radius, use the formula for the area of a circle, which is π * r^2, where r is the radius and π is a constant value.  c) Output the result: Display the calculated area.  ii. Algorithm Step 1. Start: Begin th...
Image
  LAB2 1. Considerthe following source code fragment Int a,b,c,d; a= (b + c)/d ; e= (b*c) - d;  e=(((a*b)/c)*d) Assume that q,b, c, d,e are in registers. Develop an assembly language programto performthis assignment statements. Int a,b,c,d; a= (b + c)/d ; e= (b*c) - d;  e=(((a*b)/c)*d) Assume that b,e is in registers and c, d,a in memory. Develop an assembly language programto perform this assignment statements. Int a,b,c,d; a= (b AND c) XOR d;  a=(b XOR c) OR d; Assume that a,b, c, d are in registers. Develop an assembly language programto performthis assignment statements. Int a,b,c,d; a= (b AND c) XOR d; a=(b XOR c) OR d; Assume that b, c are in registers and a,d in memory. Develop an assembly language programto perform this assignment statements. LAB 3 1. Create an array of 10 elements and initialized the array elements with random values a. Assign array[5]=0 and array[8]=0 (array is the name of the array, youcancreate array with any name) 2.Value=array[3]+ array...