hi everyone just starting ansi c but i seem to be having problems i have to make a program which checks if the user input is uppercase,lowercase or digit which i have done but for some reason i cant seem to do character counts ive tried one way but it doesnt work and im confused lol but my teacher wnt help as we have already moved on to the next program. so i just want learn what i am doing wrong for future reference.
// portfolio2.cpp : Defines the entry point for the console application.
//
#include <stdafx.h>
#include <cctype>
#include <cctype>
int _tmain(int argc, _TCHAR* argv[])
{
char a;
int i;
int count = 0;
printf("Please Enter A Character \n");
scanf( "%c", &a );
if (isupper (a))
{
for(i=0;i<a;i++)
++count;
printf("Number of characters in is %d\n", count);
printf( "You Entered Uppercase Character \n");
}
else
if (islower (a))
{
printf( "You Entered A Lowercase Character \n");
}
else
if( isdigit(a))
{
printf( "You entered a Number \n");
}
return 0;
}
any help will be apperciated thanks