C Programming Examples: Armstrong Numbers, Prime Numbers, Palindromes, and More

WAP to display armstrong number from 1 to 1000


Program :


#include <stdio.H>
void main()
{
 int i,n,d,sum=0;
 for(i=1;i<=1000;i++)
 {
 n=i;
 sum=0;
 while(n!=0)
 {
 d=n%10;
 sum=sum+d*d*d;
 n=n/10;
 }
 if(sum==i)
 {
 printf(“%d\n”,i);
 }
 }
}
Output :
1
153
370
371
407


Write a program to check if the entered number is prime or not.

Program :


#include <stdio.H>
void main()
{
 int i=2,n;
 printf(“Enter a number\n”);
 scanf(“%d”,&n);
 while(n%i!=0)
 {
 i++;
 }
 if(n==i)
 {
 printf(“The number %d

Read More

Comprehensive Guide to Computerized Accounting with Tally

Features of Computerized Accounting

Simple and Integrated: Automates and integrates business activities like sales, finance, purchase, inventory, and manufacturing, providing accurate and up-to-date information.

Accuracy & Speed: Utilizes customized templates for fast and accurate data entry, automatically generating reports.

Scalability: Adapts to changing business volumes, accommodating transaction growth.

Instant Reporting: Generates real-time, high-quality reports due to speed and accuracy.

Security:

Read More

Protection Mechanism and Segmentation in 80386 Microprocessor

Protection Mechanism of 80386:

80386 protection mechanism is provided by memory management and by privilege protection.

1. Protection by Memory Management:

Memory Management uses segmentation and paging mechanism. In segmentation mechanism, the selector selects one Descriptor from the Descriptor Table and the entry of that one Descriptor provides protection parameters such as Access type, whether the descriptor is valid or invalid, limit of the segment, and its privileged level. In Access type, the

Read More

Memory Organization and Management in Computer Architecture

Characteristics of Memory

1. Location: Based on its physical location, memory is classified into three types:

  • On-Chip: This memory is present inside the CPU. E.g.: Internal Registers and L1 Cache.
  • Internal: This memory is present on the motherboard. E.g.: RAM.
  • External: This memory is connected to the motherboard. E.g.: Hard disk.

2. Storage Capacity: This indicates the amount of data stored in the memory. Ideally, it should be as large as possible. It is represented as N x M.

  • N = Number of memory locations
Read More

Understanding MLFQ Scheduling: A Deep Dive into Multilevel Feedback Queue Algorithm

What is MLFQ Scheduling?

MLFQ (Multilevel Feedback Queue) is a scheduling algorithm designed to address the challenge of optimizing both turnaround time and response time for jobs without prior knowledge of their execution lengths. It aims to provide a responsive system for interactive users while efficiently managing CPU-bound tasks.

How MLFQ Works

Multiple Priority Queues

MLFQ employs multiple queues, each assigned a different priority level. Higher priority queues contain jobs considered more important

Read More

Software Engineering: Attributes, Processes, and Requirements

Attributes of Good Software

  • Efficiency: Software should not waste system resources like memory and processor cycles.
  • Acceptability: Software should be understandable, usable, and compatible with other systems used by the target users.

Software Engineering Costs

  • Development costs: 60%
  • Testing costs: 40%
  • Evolution costs (for custom software) often exceed development costs.

Software Processes

Plan-Driven and Agile Processes

  • Plan-driven processes: All activities are planned in advance and progress is measured
Read More