Posts

Showing posts from September, 2025

Ds

 [9/17, 8:38 AM] Rudresh Engg: #include <stdio.h> #include <string.h> // Structure definition for storing student details struct Student {     int id;              // Student ID     char name[50];       // Student name     int age;             // Student age     char address[100];   // Student address }; int main() {     int n, i;     // Ask user for number of students     printf("Enter number of students: ");     scanf("%d", &n);     // Create an array of Student structures     struct Student students[n];     // Input student details     for(i = 0; i < n; i++) {         printf("\nEnter details of student %d:\n", i+1);         printf("ID: ");         scanf("%d", &students[i].id); ...

Usp

 5. Write awk script that uses all of its features. #!/bin/awk -f BEGIN {print “START”} {print $1, “\t”, $3} END {print “DONE”} output:  [LabExam@ISELAB1 ~]$ awk -f pr5.awk a.txt And am You can Me you LabExam@ISELAB1 ~]$ cat a.txt And is am I was You they can take Me as you print 6. Write a shell script to display list of users currently logged in. #!/bin/sh echo “User logged in:” users echo “Current logged in date and time :” date echo “Currently logged in users:” who echo “Currently logged in username:” whoami output:  [LabExam@ISELAB1 ~]$ sh pr6.sh [LabExam@ISELAB1 ~]$chmod a+x pr6.sh [LabExam@ISELAB1 ~]$sh pr6.sh User logged in: UNIX LAB UNIX LAB Current logged in date and time: Sat sep 29 12:25:30 IST 2018-11-22 Currently logged in users: UNIXLAB TTY1 2018-09-29 11.08 (:0) UNIXLAB pts/0 2018-09-29 12.03 (:0.0) UNIXLAB pts/1 2018-09-29 12.28 (:0.0) Currently logged in username: UNIXLAB PART B 1. Write a C/C++ program to implement the cat command using general fi...