This document contains source code for 14 programs written in C programming language by Sumant Diwakar as part of a practical file for a Computer Programming Lab course. The programs include conversions between Fahrenheit and Celsius temperatures, checking if a number is a perfect square, sorting numbers in ascending and descending order, checking vowels, calculating factorials, and other numerical calculations and patterns. Each program section contains the source code and output for that program.
Operators and expressions in c languagetanmaymodi4
what is operator in c language
uses of operator in c language
syatax of operator in c language
program of operator in c language
what is expressions in c language
use of expressions in c language
syantax of expressions in c language
Constructors are special class functions which performs initialization of every object. The Compiler calls the Constructor whenever an object is created. Destructor on the other hand is used to destroy the class object.
Operators and expressions in c languagetanmaymodi4
what is operator in c language
uses of operator in c language
syatax of operator in c language
program of operator in c language
what is expressions in c language
use of expressions in c language
syantax of expressions in c language
Constructors are special class functions which performs initialization of every object. The Compiler calls the Constructor whenever an object is created. Destructor on the other hand is used to destroy the class object.
Ex.1 Write a program to print the following pattern
1
2 2
3 3 3
4 4 4 4
5 5 5 5 5
Ex.2 Write a program to find bigger of three integers.
Ex.3 Write a program to calculate GCD between two numbers.
Ex.4 Write a program to find transpose of matrix.
Ex.5 Write a program which deletes an element from an array & display all other elements.
Ex.6 Write a program to calculate XA+YB where A & B are matrix & X=2, Y=3.
Ex.7 Write a program to calculate the total amount of money in the piggy bank, given that coins of Rs.10, Rs.5, Rs.2, RS.1.
& many more.....
These problems are so common that you will find in any C learning curriculum. Either in your college or in any IT institute.
I have provided solutions to these problems as well.
Happy learning...
Launch Your Streaming Platforms in MinutesRoshan Dwivedi
The claim of launching a streaming platform in minutes might be a bit of an exaggeration, but there are services that can significantly streamline the process. Here's a breakdown:
Pros of Speedy Streaming Platform Launch Services:
No coding required: These services often use drag-and-drop interfaces or pre-built templates, eliminating the need for programming knowledge.
Faster setup: Compared to building from scratch, these platforms can get you up and running much quicker.
All-in-one solutions: Many services offer features like content management systems (CMS), video players, and monetization tools, reducing the need for multiple integrations.
Things to Consider:
Limited customization: These platforms may offer less flexibility in design and functionality compared to custom-built solutions.
Scalability: As your audience grows, you might need to upgrade to a more robust platform or encounter limitations with the "quick launch" option.
Features: Carefully evaluate which features are included and if they meet your specific needs (e.g., live streaming, subscription options).
Examples of Services for Launching Streaming Platforms:
Muvi [muvi com]
Uscreen [usencreen tv]
Alternatives to Consider:
Existing Streaming platforms: Platforms like YouTube or Twitch might be suitable for basic streaming needs, though monetization options might be limited.
Custom Development: While more time-consuming, custom development offers the most control and flexibility for your platform.
Overall, launching a streaming platform in minutes might not be entirely realistic, but these services can significantly speed up the process compared to building from scratch. Carefully consider your needs and budget when choosing the best option for you.
Prosigns: Transforming Business with Tailored Technology SolutionsProsigns
Unlocking Business Potential: Tailored Technology Solutions by Prosigns
Discover how Prosigns, a leading technology solutions provider, partners with businesses to drive innovation and success. Our presentation showcases our comprehensive range of services, including custom software development, web and mobile app development, AI & ML solutions, blockchain integration, DevOps services, and Microsoft Dynamics 365 support.
Custom Software Development: Prosigns specializes in creating bespoke software solutions that cater to your unique business needs. Our team of experts works closely with you to understand your requirements and deliver tailor-made software that enhances efficiency and drives growth.
Web and Mobile App Development: From responsive websites to intuitive mobile applications, Prosigns develops cutting-edge solutions that engage users and deliver seamless experiences across devices.
AI & ML Solutions: Harnessing the power of Artificial Intelligence and Machine Learning, Prosigns provides smart solutions that automate processes, provide valuable insights, and drive informed decision-making.
Blockchain Integration: Prosigns offers comprehensive blockchain solutions, including development, integration, and consulting services, enabling businesses to leverage blockchain technology for enhanced security, transparency, and efficiency.
DevOps Services: Prosigns' DevOps services streamline development and operations processes, ensuring faster and more reliable software delivery through automation and continuous integration.
Microsoft Dynamics 365 Support: Prosigns provides comprehensive support and maintenance services for Microsoft Dynamics 365, ensuring your system is always up-to-date, secure, and running smoothly.
Learn how our collaborative approach and dedication to excellence help businesses achieve their goals and stay ahead in today's digital landscape. From concept to deployment, Prosigns is your trusted partner for transforming ideas into reality and unlocking the full potential of your business.
Join us on a journey of innovation and growth. Let's partner for success with Prosigns.
We describe the deployment and use of Globus Compute for remote computation. This content is aimed at researchers who wish to compute on remote resources using a unified programming interface, as well as system administrators who will deploy and operate Globus Compute services on their research computing infrastructure.
In software engineering, the right architecture is essential for robust, scalable platforms. Wix has undergone a pivotal shift from event sourcing to a CRUD-based model for its microservices. This talk will chart the course of this pivotal journey.
Event sourcing, which records state changes as immutable events, provided robust auditing and "time travel" debugging for Wix Stores' microservices. Despite its benefits, the complexity it introduced in state management slowed development. Wix responded by adopting a simpler, unified CRUD model. This talk will explore the challenges of event sourcing and the advantages of Wix's new "CRUD on steroids" approach, which streamlines API integration and domain event management while preserving data integrity and system resilience.
Participants will gain valuable insights into Wix's strategies for ensuring atomicity in database updates and event production, as well as caching, materialization, and performance optimization techniques within a distributed system.
Join us to discover how Wix has mastered the art of balancing simplicity and extensibility, and learn how the re-adoption of the modest CRUD has turbocharged their development velocity, resilience, and scalability in a high-growth environment.
Top 7 Unique WhatsApp API Benefits | Saudi ArabiaYara Milbes
Discover the transformative power of the WhatsApp API in our latest SlideShare presentation, "Top 7 Unique WhatsApp API Benefits." In today's fast-paced digital era, effective communication is crucial for both personal and professional success. Whether you're a small business looking to enhance customer interactions or an individual seeking seamless communication with loved ones, the WhatsApp API offers robust capabilities that can significantly elevate your experience.
In this presentation, we delve into the top 7 distinctive benefits of the WhatsApp API, provided by the leading WhatsApp API service provider in Saudi Arabia. Learn how to streamline customer support, automate notifications, leverage rich media messaging, run scalable marketing campaigns, integrate secure payments, synchronize with CRM systems, and ensure enhanced security and privacy.
In the ever-evolving landscape of technology, enterprise software development is undergoing a significant transformation. Traditional coding methods are being challenged by innovative no-code solutions, which promise to streamline and democratize the software development process.
This shift is particularly impactful for enterprises, which require robust, scalable, and efficient software to manage their operations. In this article, we will explore the various facets of enterprise software development with no-code solutions, examining their benefits, challenges, and the future potential they hold.
Custom Healthcare Software for Managing Chronic Conditions and Remote Patient...Mind IT Systems
Healthcare providers often struggle with the complexities of chronic conditions and remote patient monitoring, as each patient requires personalized care and ongoing monitoring. Off-the-shelf solutions may not meet these diverse needs, leading to inefficiencies and gaps in care. It’s here, custom healthcare software offers a tailored solution, ensuring improved care and effectiveness.
In 2015, I used to write extensions for Joomla, WordPress, phpBB3, etc and I ...Juraj Vysvader
In 2015, I used to write extensions for Joomla, WordPress, phpBB3, etc and I didn't get rich from it but it did have 63K downloads (powered possible tens of thousands of websites).
Top Features to Include in Your Winzo Clone App for Business Growth (4).pptxrickgrimesss22
Discover the essential features to incorporate in your Winzo clone app to boost business growth, enhance user engagement, and drive revenue. Learn how to create a compelling gaming experience that stands out in the competitive market.
Utilocate offers a comprehensive solution for locate ticket management by automating and streamlining the entire process. By integrating with Geospatial Information Systems (GIS), it provides accurate mapping and visualization of utility locations, enhancing decision-making and reducing the risk of errors. The system's advanced data analytics tools help identify trends, predict potential issues, and optimize resource allocation, making the locate ticket management process smarter and more efficient. Additionally, automated ticket management ensures consistency and reduces human error, while real-time notifications keep all relevant personnel informed and ready to respond promptly.
The system's ability to streamline workflows and automate ticket routing significantly reduces the time taken to process each ticket, making the process faster and more efficient. Mobile access allows field technicians to update ticket information on the go, ensuring that the latest information is always available and accelerating the locate process. Overall, Utilocate not only enhances the efficiency and accuracy of locate ticket management but also improves safety by minimizing the risk of utility damage through precise and timely locates.
Developing Distributed High-performance Computing Capabilities of an Open Sci...Globus
COVID-19 had an unprecedented impact on scientific collaboration. The pandemic and its broad response from the scientific community has forged new relationships among public health practitioners, mathematical modelers, and scientific computing specialists, while revealing critical gaps in exploiting advanced computing systems to support urgent decision making. Informed by our team’s work in applying high-performance computing in support of public health decision makers during the COVID-19 pandemic, we present how Globus technologies are enabling the development of an open science platform for robust epidemic analysis, with the goal of collaborative, secure, distributed, on-demand, and fast time-to-solution analyses to support public health.
GraphSummit Paris - The art of the possible with Graph TechnologyNeo4j
Sudhir Hasbe, Chief Product Officer, Neo4j
Join us as we explore breakthrough innovations enabled by interconnected data and AI. Discover firsthand how organizations use relationships in data to uncover contextual insights and solve our most pressing challenges – from optimizing supply chains, detecting fraud, and improving customer experiences to accelerating drug discoveries.
First Steps with Globus Compute Multi-User EndpointsGlobus
In this presentation we will share our experiences around getting started with the Globus Compute multi-user endpoint. Working with the Pharmacology group at the University of Auckland, we have previously written an application using Globus Compute that can offload computationally expensive steps in the researcher's workflows, which they wish to manage from their familiar Windows environments, onto the NeSI (New Zealand eScience Infrastructure) cluster. Some of the challenges we have encountered were that each researcher had to set up and manage their own single-user globus compute endpoint and that the workloads had varying resource requirements (CPUs, memory and wall time) between different runs. We hope that the multi-user endpoint will help to address these challenges and share an update on our progress here.
Quarkus Hidden and Forbidden ExtensionsMax Andersen
Quarkus has a vast extension ecosystem and is known for its subsonic and subatomic feature set. Some of these features are not as well known, and some extensions are less talked about, but that does not make them less interesting - quite the opposite.
Come join this talk to see some tips and tricks for using Quarkus and some of the lesser known features, extensions and development techniques.
Check out the webinar slides to learn more about how XfilesPro transforms Salesforce document management by leveraging its world-class applications. For more details, please connect with sales@xfilespro.com
If you want to watch the on-demand webinar, please click here: https://www.xfilespro.com/webinars/salesforce-document-management-2-0-smarter-faster-better/
How to Position Your Globus Data Portal for Success Ten Good PracticesGlobus
Science gateways allow science and engineering communities to access shared data, software, computing services, and instruments. Science gateways have gained a lot of traction in the last twenty years, as evidenced by projects such as the Science Gateways Community Institute (SGCI) and the Center of Excellence on Science Gateways (SGX3) in the US, The Australian Research Data Commons (ARDC) and its platforms in Australia, and the projects around Virtual Research Environments in Europe. A few mature frameworks have evolved with their different strengths and foci and have been taken up by a larger community such as the Globus Data Portal, Hubzero, Tapis, and Galaxy. However, even when gateways are built on successful frameworks, they continue to face the challenges of ongoing maintenance costs and how to meet the ever-expanding needs of the community they serve with enhanced features. It is not uncommon that gateways with compelling use cases are nonetheless unable to get past the prototype phase and become a full production service, or if they do, they don't survive more than a couple of years. While there is no guaranteed pathway to success, it seems likely that for any gateway there is a need for a strong community and/or solid funding streams to create and sustain its success. With over twenty years of examples to draw from, this presentation goes into detail for ten factors common to successful and enduring gateways that effectively serve as best practices for any new or developing gateway.
Field Employee Tracking System| MiTrack App| Best Employee Tracking Solution|...informapgpstrackings
Keep tabs on your field staff effortlessly with Informap Technology Centre LLC. Real-time tracking, task assignment, and smart features for efficient management. Request a live demo today!
For more details, visit us : https://informapuae.com/field-staff-tracking/
Globus Connect Server Deep Dive - GlobusWorld 2024Globus
We explore the Globus Connect Server (GCS) architecture and experiment with advanced configuration options and use cases. This content is targeted at system administrators who are familiar with GCS and currently operate—or are planning to operate—broader deployments at their institution.
Globus Connect Server Deep Dive - GlobusWorld 2024
C Programming
1. BIRLA INSTITUTE OF TECHNOLOGY, MESRA
DEPARTMENT OF REMOTE SNSING
A
PRACTICAL FILE
ON
“COMPUTER PROGRAMMING LAB”
(TRS 2022)
MASTER OF TECHNOLOGY
(REMOTE SENSING)
(20012-2014)
SUBMITTED BY-SUMANT
KR. DIWAKAR
2. C Practical File
Program:
Write a Program in C to convert Temperature from Fahrenheit
to Celsius.
Source Code:
#include<stdio.h>
#include<conio.h>
void main()
{
float Fahrenheit, Celsius;
clrscr();
printf("Enter Temperature in Fahrenheit: ");
scanf("%f",&Fahrenheit);
Celsius = 5.0/9.0 * (Fahrenheit-32);
printf("nn Temperature in Fahrenheit = %.2f",
Fahrenheit);
printf("nn Temperature in Celsius = %.2f",
Celsius);
getch();
}
Output:
Sumant Diwakar
3. C Practical File
Program:
Write a Program in C to check the number for Perfect Square.
Source Code:
#include <stdio.h>
#include <conio.h>
void main()
{
int a, n;
clrscr();
printf("Enter a number: ");
scanf("%d", &n);
for(a = 0; a <= n; a++)
{
Sumant Diwakar
if (n == a * a)
{
printf("nntYES, Number is Perfect Square
Number");
}
}
printf("nntNO, Not a Perfect square number");
getch();
}
Output:
4. C Practical File
Program:
Write a Program in C to arrange numbers in Ascending and
Descending Order.
Source Code:
#include<stdio.h>
#include<conio.h>
void main()
{
int i,j,s,temp,a[20];
clrscr();
printf("Enter total elements: ");
scanf("%d",&s);
printf("nnEnter %d elements: ",s);
for(i=0;i<s;i++)
scanf("%d",&a[i]);
for(i=1;i<s;i++){
temp=a[i];
j=i-1;
while((temp<a[j])&&(j>=0)){
a[j+1]=a[j];
Sumant Diwakar
j=j-1;
}
a[j+1]=temp;
}
printf("nAscending Ordern");
for(i=0;i<s;i++)
printf("t %d",a[i]);
printf("nDescending Ordern ");
for(i=s-1;i>=0;i--)
printf("t %d",a[i]);
getch();
6. C Practical File
Program:
Write a Program in C to check the entered uppercase characters
for vowel using switch statement.
Source Code:
#include <stdio.h>
void main()
{
char ch;
clrscr();
printf("nInput a character in UPPERCASE only: ");
scanf("%c", &ch);
switch(ch)
{
Sumant Diwakar
case 'A':
case 'E':
case 'I':
case 'O':
case 'U':
printf("nt%c is a vowel.n", ch);
break;
default:
printf("nt%c Not in UPPERCASEn", ch);
}
getch();
}
Output:
7. C Practical File
Program:
Write a Program in C to find the Factorial of a number.
Source Code:
#include<stdio.h>
#include<conio.h>
void main()
{
int f=1,i,n;
clrscr();
printf("Enter a numbern");
scanf("%d",&n);
while(i<=n)
{
Sumant Diwakar
f=f * i;
i=i+1;
}
printf("Factorial of %d is %d",n,f);
getch();
}
Output:
8. C Practical File
Program:
Write a Program in C to find the number and their sum between
100 to 200 which are divisible by 7.
Source Code:
#include<stdio.h>
#include<conio.h>
void main()
{
int n1,n2,sum=0;
clrscr();
printf("nThe Number which are divisible by 7
arenn");
for(n1=100; n1<200; n1++)
{
Sumant Diwakar
if(n1%7==0)
{
printf("%dt",n1);
sum=sum+n1;
}
}
printf("nSum of numbers that are divisible by 7 is
= %d",sum);
getch();
}
Output:
9. C Practical File
Program:
Write a Program in C to find the number is prime number or
Composite number.
Source Code:
#include<stdio.h>
#include<conio.h>
void main()
{
int n,i,np=0; //np is boolean operator (true/false)
clrscr();
printf("n Enter a number :");
scanf("%d",&n);
for(i=2;i<=(n-1);i++)
{
Sumant Diwakar
if(n%i==0)
{
np=1;
break; //come out of for loop
}
}
if(np==1) // in if statement np=1 ,it confirms that
number is composite.
{
printf("nn%d is composite number.",n);
}
else
{
printf("nn%d is a prime number.",n);
}
getch();
}
11. C Practical File
Program:
Write a Program in C to find the Average of Five Numbers.
Source Code:
# include <stdio.h>
#include <conio.h>
void main()
{
int first, second, third, fouth, fifth, sum=0, avg=0;
clrscr();
printf("Enter First Number:");
scanf("%d", &first);
printf("nnEnter Second Number:");
scanf("%d", &second);
printf("nnEnter Third Number:");
scanf("%d", &third);
printf("nnEnter Fourth Number:");
scanf("%d", &fourth);
printf("nnEnter Fifth Number:");
scanf("%d", &fifth);
sum = (first+second+third+fourth+fifth);
avg = sum/5;
printf("nntThe Average of Five Number is : %d",avg);
getch();
}
Output:
Sumant Diwakar
12. C Practical File
Program:
Write a Program in C to find the Biggest and smallest number
from the given list of numbers.
Source Code:
#include<stdio.h>
#include<conio.h>
void main()
{
int n,big,sml,i,totalNumber;
clrscr();
printf("n How many number you will enter : ");
scanf("%d",&totalNumber);
for (i=0;i<totalNumber;i++)
{
printf("n Enter number %d : ",i+1);
scanf("%d",&n);
if(i==0)
{
big=sml=n;
}
if(big<n) big=n;
if(sml>n) sml=n;
}
printf("nnBiggest number is: %d",big);
printf("nnSmallest number is : %d",sml);
getch();
}
Sumant Diwakar
14. C Practical File
Program:
Write a Program in C to find the sum of a digit of a number.
Source Code:
#include<stdio.h>
void main()
{
int num,sum=0,r;
printf("Enter a number: ");
scanf("%d",&num);
while(num){
r=num%10;
num=num/10;
sum=sum+r;
}
printf("Sum of digits of number: %d",sum);
getch();
}
Output:
Sumant Diwakar
15. C Practical File
Program:
Write a Program in C to enter three digit numbers and find the
sum of the digits.
Source Code:
#include<stdio.h>
void main()
{
int num,sum=0,r;
clrscr();
printf("Enter a #-digit number[100-999]: ");
scanf("%d",&num);
if(num>999 && num<100)
printf("nnSorry!, Number Out of Range ");
else
{
while(num)
{
Sumant Diwakar
r=num%10;
num=num/10;
sum=sum+r;
}
printf("nSum of digits of number: %d",sum);
}
getch();
}
Output:
16. C Practical File
Program:
Write a Program in C to generate the Fibonacci Series.
(0, 1, 1, 2, 3, 5, 8…)
Source Code:
#include <stdio.h>
void main()
{
int n, first = 0, second = 1, next, c;
clrscr();
printf("Enter the number of terms:");
scanf("%d",&n);
printf("nnFirst %d terms of Fibonacci series are :-
nn",n);
for ( c = 0 ; c < n ; c++ )
{
Sumant Diwakar
if ( c <= 1 )
next = c;
else
{
next = first + second;
first = second;
second = next;
}
printf("%d ",next);
}
getch();
}
21. C Practical File
Program:
Write a Program in C to find factorial of given number using
recursive function.
Source Code:
#include<stdio.h>
main()
{
int a,b;
clrscr();
printf("Enter the value for A and Bn");
scanf("%d %d",&a,&b);
printf("nBefore Swaping:nntA= %d, B=%d",a,b);
swap(a,b);
getch();
}
swap(int x,int y)
{
int temp;
temp=x;
x=y;
y=temp;
printf("nnAfter Swaping:nntA=%d, B=%d",x,y);
}
Output:
Sumant Diwakar
23. C Practical File
Program:
Write a Program in C to find factorial of given number using
recursive function.
Source Code:
#include<stdio.h>
main()
{
int a, fact;
printf("nEnter any number: ");
scanf ("%d", &a);
fact=rec (a);
printf("nFactorial Value = %d", fact);
}
rec (int x)
{
int f;
Sumant Diwakar
if (x==1)
return (1);
else
f=x*rec(x-1);
return (f);
}
29. C Practical File
Program:
Write a Program in C to find the multiplication of two matrices.
Source Code:
#include<stdio.h>
#include<conio.h>
void main()
{
int a[5][5],b[5][5],c[5][5],i,j,k,sum=0,m,n,o,p;
clrscr();
printf("nEnter the row and column of first matrix");
scanf("%d %d",&m,&n);
printf("nEnter the row and column of second matrix");
scanf("%d %d",&o,&p);
if(n!=o)
{
Sumant Diwakar
printf("Matrix mutiplication is not possible");
printf("nColumn of first matrix must be same
as row of second matrix");
}
else
{
printf("nEnter the First matrix->");
for(i=0;i<m;i++)
for(j=0;j<n;j++)
scanf("%d",&a[i][j]);
printf("nEnter the Second matrix->");
for(i=0;i<o;i++)
for(j=0;j<p;j++)
scanf("%d",&b[i][j]);
printf("nThe First matrix isn");
for(i=0;i<m;i++){
printf("n");
for(j=0;j<n;j++){
printf("%dt",a[i][j]);
}
}
printf("nThe Second matrix isn");
30. C Practical File
for(i=0;i<o;i++){
printf("n");
for(j=0;j<p;j++){
printf("%dt",b[i][j]);
}
}
for(i=0;i<m;i++)
for(j=0;j<p;j++)
c[i][j]=0;
for(i=0;i<m;i++){ //row of first matrix
for(j=0;j<p;j++){ //column of second matrix
sum=0;
for(k=0;k<n;k++)
Sumant Diwakar
sum=sum+a[i][k]*b[k][j];
c[i][j]=sum;
}
}
}
printf("nThe multiplication of two matrix isn");
for(i=0;i<m;i++){
printf("n");
for(j=0;j<p;j++){
printf("%dt",c[i][j]);
}
}
getch();
}
32. C Practical File
Program:
Write a Program in C to find the length of a string and count the
number of vowel in it.
Source Code:
#include <stdio.h>
#include <string.h>
void main()
{
Sumant Diwakar
char str[50];
int vowels=0;
int consonants=0;
int space=0;
int len,i;
printf("enter the string n n");
gets(str);
len=strlen(str);
for(i=0; i< len ;i++)
{
if(str[i]=='a'||str[i]=='A'||str[i]=='i'||str[i]=='I'||str[i]
=='E'||str[i]=='e'||str[i]=='O'||str[i]=='o'||str[i]=='U'||st
r[i]=='u')
vowels++;
else
{
consonants++;
}
if(str[i]==' ')
{
space ++;
}
}
33. C Practical File
printf("Number of Vowels %d and Number of Consonants
%d",vowels,consonants);
Sumant Diwakar
printf(" n Number of Spaces :% d",space);
getch();
}
Output:
34. C Practical File
Program:
Write a Program in C to check the given string is Palindrome or
not .
Source Code:
# include <stdio.h>
# include <conio.h>
# include <string.h>
void main()
{
char str[20], rev[20] ;
int i, j, l ;
clrscr() ;
printf("Enter a string : ") ;
scanf("%s", str) ;
for(l = 0 ; str[l] != '0' ; l++) ;
for(i = l - 1, j = 0 ; i >= 0 ; i--, j++)
rev[j] = str[i] ;
rev[j] = '0' ;
if(strcmp(str, rev) == 0)
printf("nThe given string is a palindrome") ;
else
printf("nThe given string is not a palindrome") ;
getch() ;
}
Output:
Sumant Diwakar