Logo 
Search:

C Programming Articles

Submit Article
Home » Articles » C Programming » BeginnersRSS Feeds

Love Calculator

Posted By: Muhammed Athil     Category: C Programming     Views: 35902

Calculate Your Love percentage

#include<stdio.h>
#include<conio.h>
void main()
{

int i,l1;
long int s1,s2,t;
char name1[50],name2[50];
void title(),del();
clrscr();
title();
printf("NOTE\n----\nThe information showing in this program is not CORRECT, It is just for fun");
delay(5000);
clrscr();
title();
printf("Please Enter your name\n");
scanf("%s",name1);
printf("Please Enter your partner's name\n" );
scanf("%s",name2);
printf("Please wait Calculating.");
for(i=0;i<8;i++)
{
del();
}
clrscr();
title();
printf("Calculation completed");
delay(1000);
clrscr();
title();
printf("Press any key to view result");

l1=0;
for(i=0;i<50;i++)
{
if (name1[i]!='\0')
{
l1++;
continue;
}
break;
}
s1=0;
for(i=0;i<l1;i++)
{
s1=s1+name1[i];
}
getch();
l1=0;
for(i=0;i<50;i++)
{
if (name2[i]!='\0')
{
l1++;
continue;
}
break;
}
s2=0;
for(i=0;i<l1;i++)
{
s2=s2+name2[i];
}
t=s1+s2;
while(t>100)
{
    t=t/10;
}
clrscr();
title();
printf("the result is %ld%",t);
getch();
}
void title()
{
printf("!!!!!!!!! Love Calculator !!!!!!!!!\n");
}
void del()
{
delay(500);
printf("..");
}
  
Share: 


Didn't find what you were looking for? Find more on Love Calculator Or get search suggestion and latest updates.

Muhammed Athil
Muhammed Athil author of Love Calculator is from Calicut, India. Muhammed Athil says

Hello Everyone,I am Muhammed Athil from India

 
View All Articles

 
Please enter your Comment

  • Comment should be atleast 30 Characters.
  • Please put code inside [Code] your code [/Code].

 
Muhammed Athil from India Comment on: Jan 15
@sarada prasad

l1 is used to find the length of the first name
l2 is for second name

s1 is used to take the sum of first name value
s2 is for second name

Muhammed Athil from India Comment on: Jan 15
@Ritesh Rana
I dont know which compiler U are using I am using turboc++ compiler
plz download it and install

unclecoder.com/article/28/C/TurboCInstallation

Muhammed Athil from India Comment on: Jan 15
@ SARADA PRASAD
It's a Simple Logic that I used here.
By taking each character of names and simply adding this characters like
for A = 65

View All Comments