it is supposed to be c++..
so i got a little work done myself and i got this code which does not work right now and i can't find the problem... it compiles without errors but when i run it number of consonants or "integer count" turns out to be zero.. could the problem be fact that im using croatian letters?
Code:
#include <stdio.h>
#include <conio.h>
#include <ctype.h>
#include<stdlib.h>
int main()
{
system("cls");
int count=0;
char ce;
printf("Enter a charracter:");
do
{
ce=getche();
char t = tolower(ce);
if (t == 'q' && t == 'w' && t == 'r' && t == 'z' && t == 'p' && t == 'š' && t == 'đ'
&& t == 's' && t == 'd' && t == 'f' && t == 'g' && t == 'h' && t == 't'
&& t == 'j' && t == 'k' && t == 'l' && t == 'č' && t == 'ć' && t == 'ž'
&&t == 'y' && t == 'x' && t == 'c' && t == 'v' && t == 'b' && t == 'n' && t == 'm')
count++;
}
while (ce!='a');
printf("\nNumber of consonants:%d",count);
getche();
system("pause");
}
i went with this because the last program that worked with condition " if (t!='a'&&t!='u'&&t!='i'&&t!='o'&&t!='e')" counted "space" and "enter" keys as consonants...