Skip to main content

Posts

Recent posts

Trending technology in computer science

 As of my last knowledge update in September 2021, some of the trending technologies in computer science were: 1. Artificial Intelligence (AI) and Machine Learning (ML): AI and ML continue to be at the forefront of technological advancements. These fields encompass a wide range of applications such as natural language processing, computer vision, robotics, and predictive analytics. 2. Internet of Things (IoT): IoT refers to the network of interconnected physical devices embedded with sensors, software, and network connectivity. It enables these devices to collect and exchange data, leading to advancements in smart homes, healthcare, transportation, and industrial automation. 3. Blockchain: Blockchain technology provides secure and transparent transaction records by creating a decentralized and immutable ledger. It has applications in cryptocurrency, supply chain management, voting systems, and data integrity. 4. Cybersecurity: With the increasing number of cyber threats and data breach

Which Type of service are provided by AWS ?

AWS (Amazon Web Services) is a comprehensive cloud computing platform provided by Amazon. It offers a wide range of services that enable individuals, businesses, and organizations to build and deploy various types of applications and services in the cloud. Some of the key services provided by AWS include: 1. Compute Services: AWS provides scalable and flexible computing resources, including virtual servers (Amazon EC2), serverless computing (AWS Lambda), and container management (Amazon ECS and Amazon EKS). 2. Storage Services: AWS offers various storage options, such as object storage (Amazon S3), file storage (Amazon EFS), and block storage (Amazon EBS) for different types of data storage needs. 3. Database Services: AWS provides managed database services, including relational databases (Amazon RDS), NoSQL databases (Amazon DynamoDB), in-memory databases (Amazon ElastiCache), and data warehousing (Amazon Redshift). 4. Networking Services: AWS offers networking capabilities, such as v

How to Become AI/ML Engineer?

Becoming an AI (Artificial Intelligence) and ML (Machine Learning) engineer can be an exciting and rewarding career path. Here's a step-by-step guide to help you get started: 1. Build a strong foundation in mathematics and programming: AI and ML heavily rely on concepts from mathematics, especially linear algebra, calculus, and probability. Strengthen your mathematical skills. Additionally, learn programming languages such as Python, which is widely used in the AI and ML community. 2. Understand the basics of AI and ML: Familiarize yourself with the fundamental concepts of AI and ML. Study topics like supervised and unsupervised learning, regression, classification, neural networks, and deep learning. There are numerous online courses, tutorials, and books available to help you learn these concepts. 3. Learn popular ML frameworks and libraries: Gain hands-on experience with popular ML frameworks and libraries such as TensorFlow, PyTorch, and scikit-learn. These tools simplify the d

What is Cloud computing?

Cloud computing refers to the delivery of computing resources and services over the internet, allowing users to access and use applications, storage, and processing power without the need for local infrastructure or hardware. It involves the use of remote servers, typically hosted in data centers, to store, manage, and process data instead of relying on a local computer or server. In cloud computing, users can access a wide range of services and resources on-demand, which are usually provided by a cloud service provider (CSP). These services can include infrastructure resources (such as virtual machines, storage, and networking), platforms for developing and deploying applications, and software applications that can be accessed and used via the internet. Cloud computing offers several advantages over traditional on-premises computing models. It allows for scalability, where users can easily scale up or down their resource usage based on their needs, without having to invest in and mana

HTML TABLE CODE

<! DOCTYPE   html > < html   lang = "en" > < head >     < meta   charset = "UTF-8" >     < meta   http-equiv = "X-UA-Compatible"   content = "IE=edge" >     < meta   name = "viewport"   content = "width=device-width, initial-scale=1.0" >     < title >this is form</ title >     < script >          function   checkdetail () {              var  x  =  document.frm.n.value;              if  (x  ==   null   ||  x  ==   " "   ||  x.length  >   15   ||  x.length  <   3 ) {                  alert ( "Enter your name properly" );                  return   false ;             }              var  y  =  document.frm.e.value;              if  (y  ==   null   ||  y  ==   " "   ||  y.length  >   20   ||  y.length  <   3 ) {                  alert ( "Enter your email properly" );                  return   false ;             }             

C Program to Display its own Source Code as Output

  C program to display its own source code # include <stdio.h> int main () { FILE *fp; int c;     // open the current input file fp = fopen(__FILE__, "r" ); do { c = getc(fp); // read character putchar (c); // display character } while (c != EOF); // loop until the end of file is reached   fclose(fp); return 0 ; }

C Program to Read a Line From a File and Display it

  Program to read text from a file # include <stdio.h> # include <stdlib.h> // For exit() function int main () { char c[ 1000 ]; FILE *fptr; if ((fptr = fopen( "program.txt" , "r" )) == NULL ) { printf ( "Error! opening file" ); // Program exits if file pointer returns NULL. exit ( 1 ); } // reads text until newline is encountered fscanf (fptr, "%[^\n]" , c); printf ( "Data from the file:\n%s" , c); fclose(fptr); return 0 ; } If the file is found, the program saves the content of the file to a string  c  until  '\n'  newline is encountered. Suppose the  program.txt  file contains the following text in the current directory. C programming is awesome. I love C programming. How are you doing? The output of the program will be: Data from the file: C programming is awesome. If the file  program.txt  is not found, this program prints an error message.

C Program to Write a Sentence to a File

  This program stores a sentence entered by the user in a file. # include <stdio.h> # include <stdlib.h> int main () { char sentence[ 1000 ]; // creating file pointer to work with files FILE *fptr; // opening file in writing mode fptr = fopen( "program.txt" , "w" ); // exiting program if (fptr == NULL ) { printf ( "Error!" ); exit ( 1 ); } printf ( "Enter a sentence:\n" ); fgets(sentence, sizeof (sentence), stdin ); fprintf (fptr, "%s" , sentence); fclose(fptr); return 0 ; } Output Enter a sentence: C Programming is fun Here, a file named program.txt is created. The file will contain C programming is fun text.

C Program to Store Data in Structures Dynamically

  Demonstrate the Dynamic Memory Allocation for Structure # include <stdio.h> # include <stdlib.h> struct course { int marks; char subject[ 30 ]; }; int main () { struct course * ptr ; int i, noOfRecords; printf ( "Enter the number of records: " ); scanf ( "%d" , &noOfRecords); // Memory allocation for noOfRecords structures ptr = (struct course *) malloc (noOfRecords * sizeof (struct course)); for (i = 0 ; i < noOfRecords; ++i) { printf ( "Enter the name of the subject and marks respectively:\n" ); scanf ( "%s %d" , (ptr + i)->subject, &(ptr + i)->marks); } printf ( "Displaying Information:\n" ); for (i = 0 ; i < noOfRecords; ++i) printf ( "%s\t%d\n" , (ptr + i)->subject, (ptr + i)->marks); return 0 ; } Output Enter the number of records: 2 Enter the name of the subject and marks respectivel

C Program to Calculate Difference Between Two Time Periods

  Calculate Difference Between Two Time Periods # include <stdio.h> struct TIME { int seconds; int minutes; int hours; }; void differenceBetweenTimePeriod (struct TIME t1, struct TIME t2, struct TIME *diff) ; int main () { struct TIME startTime , stopTime , diff ; printf ( "Enter the start time. \n" ); printf ( "Enter hours, minutes and seconds: " ); scanf ( "%d %d %d" , &startTime.hours, &startTime.minutes, &startTime.seconds); printf ( "Enter the stop time. \n" ); printf ( "Enter hours, minutes and seconds: " ); scanf ( "%d %d %d" , &stopTime.hours, &stopTime.minutes, &stopTime.seconds); // Difference between start and stop time differenceBetweenTimePeriod(startTime, stopTime, &diff); printf ( "\nTime Difference: %d:%d:%d - &quo

C Program to Add Two Complex Numbers by Passing Structure to a Function

  Add Two Complex Numbers # include <stdio.h> typedef struct complex { float real; float imag; } complex ; complex add ( complex n1, complex n2) ; int main () { complex n1, n2, result; printf ( "For 1st complex number \n" ); printf ( "Enter the real and imaginary parts: " ); scanf ( "%f %f" , &n1.real, &n1.imag); printf ( "\nFor 2nd complex number \n" ); printf ( "Enter the real and imaginary parts: " ); scanf ( "%f %f" , &n2.real, &n2.imag); result = add(n1, n2); printf ( "Sum = %.1f + %.1fi" , result.real, result.imag); return 0 ; } complex add ( complex n1, complex n2) { complex temp; temp.real = n1.real + n2.real; temp.imag = n1.imag + n2.imag; return (temp); } Output For 1st complex number Enter the real and imaginary parts: 2.1 -2.3 For 2nd complex number Enter the real and imaginary parts: 5.6 23.2

C Program to Add Two Distances (in inch-feet system) using Structures

  Program to add two distances in the inch-feet system # include <stdio.h> struct Distance { int feet; float inch; } d1, d2, result; int main () { // take first distance input printf ( "Enter 1st distance\n" ); printf ( "Enter feet: " ); scanf ( "%d" , &d1.feet); printf ( "Enter inch: " ); scanf ( "%f" , &d1.inch); // take second distance input printf ( "\nEnter 2nd distance\n" ); printf ( "Enter feet: " ); scanf ( "%d" , &d2.feet); printf ( "Enter inch: " ); scanf ( "%f" , &d2.inch); // adding distances result.feet = d1.feet + d2.feet; result.inch = d1.inch + d2.inch; // convert inches to feet if greater than 12 while (result.inch >= 12.0 ) { result.inch = result.inch - 12.0 ; ++result.feet; } printf ( "\nSum of distances = %d\'-%.1f\"" , result.f

C Program to Sort Elements in Lexicographical Order (Dictionary Order)

  Sort strings in the dictionary order # include <stdio.h> # include <string.h> int main () { char str[ 5 ][ 50 ], temp[ 50 ]; printf ( "Enter 5 words: " ); // Getting strings input for ( int i = 0 ; i < 5 ; ++i) { fgets(str[i], sizeof (str[i]), stdin ); } // storing strings in the lexicographical order for ( int i = 0 ; i < 5 ; ++i) { for ( int j = i + 1 ; j < 5 ; ++j) { // swapping strings if they are not in the lexicographical order if ( strcmp (str[i], str[j]) > 0 ) { strcpy (temp, str[i]); strcpy (str[i], str[j]); strcpy (str[j], temp); } } } printf ( "\nIn the lexicographical order: \n" ); for ( int i = 0 ; i < 5 ; ++i) { fputs (str[i], stdout ); } return 0 ; } Output Enter 5 words: R programming JavaScript Java C programming C++ programming In the lexicographical order: C programming C+