|
INTERVIEW QUESTIONS
C
C BASICS
DETAILS
Question: how to create love flames program using c language
Answer: #include<stdio.h> #include<conio.h> #include<string.h> void main() { int i,j,n,c,s=0,p,t,y; char a[25],b[25],m,q[25],w[25]; clrscr(); printf("Enter Ur Name "); scanf("%s",a);
printf("Enter Ur Partner's Name "); scanf("%s",b); strcpy(q,a); strcpy(w,b); n=strlen(a); c=strlen(b); for(i=0;i<n;i++) { m=a[i]; for(j=0;j<c;j++) { if(m==b[j]) { a[i]=-1; b[j]=-1; s=s+2; break; } } } p=n+c; puts(a); puts(b); t=p-s; printf("The count value is %d",t);
if(t==2 || t==4 || t==7 ||t==9 ) printf(" %s is ENEMY to %s ĺ",q,w); else if (t==3 || t==5 || t==14) printf(" %s is FRIEND to %s ",q,w); else if(t==6 || t==11 || t==15 ) printf(" %s is going to MARRY %s “+“",q,w); else if(t==10) printf(" %s is in LOVE with %s ",q,w); else if(t==8) printf(" %s has more AFFECTION on %s ",q,w); else printf(" %s and %s are SISTERS/BROTHERS ",q,w); getch(); }
|
|
|
Category |
C Basics Interview Questions & Answers -
Exam Mode /
Learning Mode
|
Rating |
(0.3) By 8447 users |
Added on |
8/26/2013 |
Views |
74512 |
Rate it! |
|
|
Question:
how to create love flames program using c language
Answer:
#include<stdio.h> #include<conio.h> #include<string.h> void main() { int i,j,n,c,s=0,p,t,y; char a[25],b[25],m,q[25],w[25]; clrscr(); printf("Enter Ur Name "); scanf("%s",a);
printf("Enter Ur Partner's Name "); scanf("%s",b); strcpy(q,a); strcpy(w,b); n=strlen(a); c=strlen(b); for(i=0;i<n;i++) { m=a[i]; for(j=0;j<c;j++) { if(m==b[j]) { a[i]=-1; b[j]=-1; s=s+2; break; } } } p=n+c; puts(a); puts(b); t=p-s; printf("The count value is %d",t);
if(t==2 || t==4 || t==7 ||t==9 ) printf(" %s is ENEMY to %s ĺ",q,w); else if (t==3 || t==5 || t==14) printf(" %s is FRIEND to %s ",q,w); else if(t==6 || t==11 || t==15 ) printf(" %s is going to MARRY %s “+“",q,w); else if(t==10) printf(" %s is in LOVE with %s ",q,w); else if(t==8) printf(" %s has more AFFECTION on %s ",q,w); else printf(" %s and %s are SISTERS/BROTHERS ",q,w); getch(); } Source: CoolInterview.com
Answered by: suganthi.r | Date: 7/25/2009
| Contact suganthi.r
If you have the better answer, then send it to us. We will display your answer after the approval.
Rules to Post Answers in CoolInterview.com:-
- There should not be any Spelling Mistakes.
- There should not be any Gramatical Errors.
- Answers must not contain any bad words.
- Answers should not be the repeat of same answer, already approved.
- Answer should be complete in itself.
|
|
Related Questions |
View Answer |
|
Can anyone please tell me about a website from which I could install Turbo C (compiler) for free??
|
View Answer
|
|
What is the use of semicolon at the end of every statement?
|
View Answer
|
|
What are the packages in c?
|
View Answer
|
|
What is object file? How can you access object file?
|
View Answer
|
|
Is there anything you can do in C++ that you cannot do in C ?
|
View Answer
|
|
What is an abstract base class?
|
View Answer
|
|
What is the difference between compile time error and run time error?
|
View Answer
|
|
What is the difference between #include <file> and #include �file�
|
View Answer
|
|
When we access the integer and the character variables without declaring them in program?and Why?
|
View Answer
|
|
Can we execute printf statement without using semicolan?
|
View Answer
|
|
How to perform addition,subtraction of 2 numbers without using addition and subtraction operators?
|
View Answer
|
|
What are the applications and advantages of C-language?
|
View Answer
|
|
Define structural language and procedural language?
|
View Answer
|
|
how do i get started for any project?
|
View Answer
|
|
How to write a C program for displaying a sentence without output command?
|
View Answer
|
|
How to print value without using any output statements?
|
View Answer
|
|
How to find a given number is armstrong number or not in "c".?
|
- C Basics Interview Questions & Answers">
View Answer
|
|
How do you print an address?
|
View Answer
|
|
What is the difference between #include <file> and #include “file”?
|
View Answer
|
|
What is #line used for?
|
View Answer
|
Please Note: We keep on updating better answers to this site. In case you are looking for Jobs, Pls Click Here Vyoms.com - Best Freshers & Experienced Jobs Website.
View All C Basics Interview Questions & Answers - Exam Mode /
Learning Mode
|