Category Archives: Codes

Mission laravel: Installation

laravel installation:

example for me:

in this case laravel will install from the latest version

Frequency of Digit in A Number

code:

Ref: http://www.codeforwin.in/2016/10/c-program-to-count-frequency-of-digits-in-number.html

Logic to Find First and Last Digit

Last Digit:

First Digit:

 

 

String Frequency Count

code:
simple code:

good output:

Reference: http://www.codeforwin.in/2015/04/c-program-to-calculate-the-frequency-of-each-character-in-a-line.html

101cproblems.com solution:

 

 

String Palindrome Problem

My Own Logic:

Another logic:

Simple:

another good logic:

 

 

Count word

Problem from 101cproblems.com:
Write a program which will take a sentence as input and tell us how many words are there. [If user gives input “I love Bangladesh”, then the output should be: 3]

code:

 

String Problem: Uppercase to Lowercase, Lowercase to Uppercase

Problem 70: Case Fix

You are given a string mixed with uppercase and lowercase letters . Your task is to write a program which will
flip the letters : (UpperCase -> LowerCase, LowerCase -> UpperCase)

Example:
INPUT:        OUTPUT:

eLepHanT   Elephant

cAt                  Cat

SuNDAY       Sunday

code:

not upto the output yet:

beautiful code with exacts output:

 

 

String Problem: ASCII table related

Problem: Write a program which takes a string of alphabet as input and replace all the characters with the 3rd immediate character of it. All the alphabets of the input string will be small letter. [If user gives input “abc” you should print “def”, if user gives input “xyz” you should print “abc”]

mycode:

 

Concatanated String Problems

Problem: Take three different string as input from the user(“We”, “ Love” and “ Bangladesh”). Now concate these three string and print it (“We Love Bangladesh”). [There is a leading space in “ Love” and “ Bangladesh”]

Code:

Another approach:

 

Reverse a string

Problem 65: Reverse
Take a word from user and print the word in reverse order. [If user gives  “BANGLADESH”, your program should print “HSEDALGNAB”]

code:

of another option:

 

Array Self Input Size

 

integer odd even

problem: (courtesy:101cproblems.com)
Take an array of integer data type of size 5. Scan the values from the user. Now print the output like the following one-
Values in array: 10 25 20 15 30
Sum of odd values: 40
Sum of even values: 60

code:

Array Value Average

Take an array of integer data type of size 5. Scan the values from the user. Now print the average of integers which are greater than 100.

 

 

Find maximum and minimum value in an array

for maximum:

 

for minimum:

 

2d array codes

 

Code: