Day 17: Sorting of numbers using array.
Swapping: The process of exchanging the values of any two variable is called swapping. For example, if a=5,b=6 After swapping, b=5, a=6 t=a; //t=5 a=b;//a=6 b=t;//b=5 Sorting: Sorting is the…
Swapping: The process of exchanging the values of any two variable is called swapping. For example, if a=5,b=6 After swapping, b=5, a=6 t=a; //t=5 a=b;//a=6 b=t;//b=5 Sorting: Sorting is the…
1. Write the advantage of pointer. Write a C program to enter the radius of a football and find the area of football by using user defined function. Answer:Followings are…
#include <stdio.h> int main() { float length, width, height, volume; // Prompt the user to enter the dimensions of the box printf("Enter the length of the box: "); scanf("%f", &length);…
#include <stdio.h> #define PI 3.14159 int main() { float radius, area; // Prompt the user to enter the radius of the circle printf("Enter the radius of the circle: "); scanf("%f",…
#include <stdio.h> int main() { float principal, rate, time, interest; // Prompt the user to enter the principal, rate, and time printf("Enter the principal amount: "); scanf("%f", &principal); printf("Enter the…
#include <stdio.h> int main() { float length, width, perimeter; // Prompt the user to enter the length and width of the rectangle printf("Enter the length of the rectangle: "); scanf("%f",…
#include <stdio.h> #define PI 3.14159 int main() { float radius, circumference; // Prompt the user to enter the radius of the circle printf("Enter the radius of the circle: "); scanf("%f",…
Following is a program to display the sum of two numbers. #include<stdio.h> #include<conio.h> void main() { clrscr(); int a,b,s; printf("Enter any two numbers\n"); scanf("%d%d",&a,&b); s=a+b; printf("The sum is %d\n",s); getch();…
Following is a program to display "Hello World" in C programming. #include<stdio.h> #include<conio.h> void main() { clrscr(); printf("Hello World"); getch(); } Output: Hello World Let's break down the code step…