#include <iostream>
#include <conio.h>
#include <stdio.h>
using namespace std;
int main()
{
char str[100];
int i,totChar;
totChar=0;
cout<<"Te rog introduce un numar\n";
gets(str);
//count characters of a string wit out space
i=0;
while(str[i] != '\0'){
if(str[i]!=' ')// this condition is used to avoid counting space
{
totChar++;
}
i++;
}
cout<<"Numarul total de caractere din numarul introdus este = "<<totChar;
getch();
return 0;
}
Sper ca te-am ajutat.