C program to design love calculator (2024)

  • Home
  • DS & Algo. ▾
    • Data Structure
    • Algorithms
    • Coding Problems
  • Languages ▾
    • C
    • C++
    • C++ STL
    • Java
    • Python
    • Scala
    • Ruby
    • C#.Net
    • Golang
    • Android
    • Kotlin
    • SQL
  • Web. ▾
    • JavaScript
    • CSS
    • jQuery
    • PHP
    • Node.Js
    • AdonisJs
    • VueJS
    • Ajax
    • HTML
    • Django
  • Programs ▾
    • C
    • C++
    • Data Structure
    • Java
    • C#.Net
    • VB.Net
    • Python
    • PHP
    • Golang
    • Scala
    • Swift
    • Rust
    • Ruby
    • Kotlin
    • C Interview Programs
  • Aptitude ▾
    • C Aptitude
    • C++ Aptitude
    • Java Aptitude
    • C# Aptitude
    • PHP Aptitude
    • Linux Aptitude
    • DBMS Aptitude
    • Networking Aptitude
    • AI Aptitude
    • More...
  • Interview ▾
    • Golang
    • MIS Executive
    • DBMS
    • C
    • Embedded C
    • Java
    • SEO
    • HR
  • Find Output ▾
    • C
    • C++
    • C#.Net
    • Java
    • Go
    • PHP
    • More...
  • MCQs ▾
    • Web Technologie MCQs
    • CS Subjects MCQs
    • Databases MCQs
    • Programming MCQs
    • Testing Software MCQs
    • Digital Mktg Subjects MCQs
    • Cloud Computing S/W MCQs
    • Engineering Subjects MCQs
    • Commerce MCQs
    • More MCQs...
  • CS Subjects ▾
    • Machine Learning/AI
    • Operating System
    • Computer Network
    • Software Engineering
    • Discrete Mathematics
    • Digital Electronics
    • Data Mining
    • MIS
    • DBMS
    • Embedded Systems
    • Cryptography
    • CS Fundamental
    • More Tutorials...
  • More ▾
    • Tech Articles
    • Puzzles
    • Full Forms
    • Code Examples
    • Blogs
    • Guest Post
    • Programmer's Calculator
    • XML Sitemap Generator
    • About
    • Contact

Home »C programs »C advance programs

This program will read you and your partner's name and behalf on entered names program will calculate your love percentage. Since there is no such kind of logic to calculate the program, we made this program for fun only. This is a small game to pass your time by calculating love percentage between you and your partner. And off course you can also calculate the love percentage with others girl to see how much you love will success with your secrete partner. So enjoy the game.

Calculate Love Percentage using C program

/*C program to design love calculator.*/#include <stdio.h>#include <string.h>#include <ctype.h>//function will return sum of all digitsint sumOfDigits(int num){ int sum = 0; while (num > 0) { sum += (num % 10); num /= 10; } return sum;}int main(){ char yName[40], pName[40]; int sum, sum1, i, choice; float perc = 0; do { printf("Enter your name: "); fflush(stdin); gets(yName); printf("Enter your partner's name: "); fflush(stdin); gets(pName); sum = 0; for (i = 0; i < (strlen(yName)); i++) { sum += tolower(yName[i]); } sum1 = 0; for (i = 0; i < (strlen(yName)); i++) { sum1 += tolower(pName[i]); } perc = (sumOfDigits(sum) + sumOfDigits(sum1)) + 40; if (perc > 100) perc = 100; printf("Your love percentage is: %.02f\n\n", perc); printf("Want to calculate with some one else (0 to exit, 1 to continue) ???: "); scanf("%d", &choice); } while (choice != 0); return 0;}

Output:

 Enter your name: Mike Enter your partner's name: Lilly Your love percentage is: 63.00 Want to calculate with some one else (0 to exit, 1 to continue) ???: 1 Enter your name: Mike Enter your partner's name: Rosy Your love percentage is: 59.00 Want to calculate with some one else (0 to exit, 1 to continue) ???: 1 Enter your name: Mike Enter your partner's name: Alessia Your love percentage is: 55.00 Want to calculate with some one else (0 to exit, 1 to continue) ???: 0

C Advance Programs »

Age Calculator (C program to calculate age)

C program to guess a random number


Related Programs

  • C program to solve Polynomial and Differential Equations
  • C program to demonstrate zombie process
  • C program to demonstrate orphan process
  • C program to declare memory for an integer variable dynamically
  • C program to read and print name, where memory for variable should be declared at run time
  • C program to find sum of array elements using Dynamic Memory Allocation
  • C Program to find the sum of digits of a number until a single digit is occurred
  • C program to find class of an IP Address
  • Stringizing Operator in C - Program to print variable name in C
  • Function Pointer example program in C programming
  • C program to get current System Date and Time in Linux
  • C program to implement gotoxy(),clrscr(),getch(),getche() for GCC, Linux
  • C program to find the size of a file in Linux
  • C program to get Process Id and Parent Process Id in Linux
  • fork() function explanation and examples in Linux C
  • C program to Get Computer System IP Address in Linux
  • C program to Set Computer System IP Address in Linux
  • C program to design flying characters Screen Saver
  • C program to design a TIC TAC TOE game
  • Age Calculator (C program to calculate age)
  • C program to guess a random number
  • C program to check given string is a valid IPv4 address or not
  • C program to convert String into Hexadecimal
  • C program to demonstrate example of Variable Arguments
  • C program to store time in an integer variable
  • C program to store date in an integer variable
  • C program to remove consecutive repeated characters from string
  • C program to create your own header file
  • EMI Calculator (C program to calculate EMI)
  • C program to validate date (Check date is valid or not)
  • C program to format/extract ip address octets
  • C program to implement substring function
  • C program to design a digital clock
  • C program to convert hexadecimal Byte to integer
  • C program to extract bytes from an integer (Hexadecimal) value
  • C program to print character without using format specifiers
  • C program to find Binary Addition and Binary Subtraction
  • C program to print weekday of given date
  • C program to calculate compound interest
  • C program to implement your own sizeof using macro
  • C program to get the current date and time using the ctime() function
  • C program to get the current UTC time
  • C program to demonstrate the sleep() and usleep() functions for Linux operating system
  • C program to demonstrate the nanosleep() function

Comments and Discussions!

Load comments ↻


C program to design love calculator (2024)
Top Articles
Latest Posts
Article information

Author: Pres. Lawanda Wiegand

Last Updated:

Views: 6346

Rating: 4 / 5 (71 voted)

Reviews: 86% of readers found this page helpful

Author information

Name: Pres. Lawanda Wiegand

Birthday: 1993-01-10

Address: Suite 391 6963 Ullrich Shore, Bellefort, WI 01350-7893

Phone: +6806610432415

Job: Dynamic Manufacturing Assistant

Hobby: amateur radio, Taekwondo, Wood carving, Parkour, Skateboarding, Running, Rafting

Introduction: My name is Pres. Lawanda Wiegand, I am a inquisitive, helpful, glamorous, cheerful, open, clever, innocent person who loves writing and wants to share my knowledge and understanding with you.