Jump to content

.

AnotherTechGuy

#include <iostream>

using namespace std;

int main (){

    for (int i = 0; i < 8; i++) {

        for (int j = 0; j < 8; j++) {

            if (j != 7) {

                cout << "|_";

            }

            else {

                cout << "|_|";

            }

        }

        cout << endl;

    }

    cin.get();

    return 0;

}

Link to comment
Share on other sites

Link to post
Share on other sites

Hope this was what you were looking for

 

The output

Our string HelloWorld123String Length 13Number Of Digits 3Number Of Capitals 2
#include <stdio.h>#include <string.h>#include <ctype.h>int main(int argc, char **argv) {	char *myString = "HelloWorld123";	int myStringLength = strlen(myString); // strlen returns the size of any string	int numberOfDigits = 0;	int numberOfCapitals = 0;	// iterate through each letter one at a time	for (int i = 0; i < myStringLength; i++) {		char letter = myString[i];		// first check to see if its a number		if (isdigit(letter)) {			numberOfDigits++; // increase the number count value		}		// check if its an alphabetic character and check if its uppercase		else if (isalpha(letter) && isupper(letter)) {			numberOfCapitals++; // increase the number of caplitals value		}	}	// print out our values	printf("Our string %s\nString Length %d\nNumber Of Digits %d\nNumber Of Capitals %d\n", myString, myStringLength, numberOfDigits, numberOfCapitals);	return 0;}

a

Link to comment
Share on other sites

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×