Reasoning Program
I am a beginner of c-language and I have created this reasoning program to generate or using the logic for reasoning related questions. But I think this code can be modified further to make it more useful so please send your suggestions and use it.
Program To Find The Given Letter.
Coding:-

/*Program to find The Required number*/
#include<stdio.h>
#include<conio.h>
void main()
{
int a,b,c,d,e;
clrscr();
printf("\n Choose The Sequence Of Letters");
printf("\n 1. A to Z.");
printf("\n 2. Reverse Order.");
printf("\n\n\t\t\t");
scanf("%d",&a);
printf("\n Enter the number of the letter - ");
scanf("%d",&b);
printf("\n Direction \n Left End - 1.\n Right End - 2.\n");
scanf("%d",&e);
getch();
clrscr();
/*Logic*/
/*Normal Order*/
if(a==1 && e==1)
c=b;
if(a==1 && e==2)
c=27-b;
printf("\n%d",c);
/*Reverse order*/
if(a==2 && e==1)
c=27-b;
if(a==2 && e==2)
c=b;
/*Output*/
printf("\n YOURNUMBER - %d",b);
printf("\n Required Number - %dth",c);
printf("\n The required letter is at %dth number tally your answer.",c);
printf("\n A-1 B-2 C-3 D-4 E-5 F-6 G-7 H-8 I-9 J-10 K-11 L-12 M-13 \n N-14 O-15");
printf(" P-16 Q-17 R-18 S-19 T-20 U-21 V-22 W-23 X-24 Y-25 Z-26");
getch();
}
Note:- If their is any error please comment it.
I am a beginner of c-language and I have created this reasoning program to generate or using the logic for reasoning related questions. But I think this code can be modified further to make it more useful so please send your suggestions and use it.
Program To Find The Given Letter.
Coding:-

/*Program to find The Required number*/
#include<stdio.h>
#include<conio.h>
void main()
{
int a,b,c,d,e;
clrscr();
printf("\n Choose The Sequence Of Letters");
printf("\n 1. A to Z.");
printf("\n 2. Reverse Order.");
printf("\n\n\t\t\t");
scanf("%d",&a);
printf("\n Enter the number of the letter - ");
scanf("%d",&b);
printf("\n Direction \n Left End - 1.\n Right End - 2.\n");
scanf("%d",&e);
getch();
clrscr();
/*Logic*/
/*Normal Order*/
if(a==1 && e==1)
c=b;
if(a==1 && e==2)
c=27-b;
printf("\n%d",c);
/*Reverse order*/
if(a==2 && e==1)
c=27-b;
if(a==2 && e==2)
c=b;
/*Output*/
printf("\n YOURNUMBER - %d",b);
printf("\n Required Number - %dth",c);
printf("\n The required letter is at %dth number tally your answer.",c);
printf("\n A-1 B-2 C-3 D-4 E-5 F-6 G-7 H-8 I-9 J-10 K-11 L-12 M-13 \n N-14 O-15");
printf(" P-16 Q-17 R-18 S-19 T-20 U-21 V-22 W-23 X-24 Y-25 Z-26");
getch();
}
Note:- If their is any error please comment it.
No comments:
Post a Comment