Posts

Write a C++ program that outputs the following text on screen:

Image
text-oh what a happy day ! oh yes, solution / / Let's go  ! #include  <iostream> uning namespace std; int main ( ) {      count  << "  oh what " << endl ;      count  << "  a happy day! " << endl;      count  << "  oh yes, " << endl;      count  << "  what a happy day! " << endl;            return  o ; }

String operations in C language.

Image
We have already mentioned the mentioned the string functions strlen, strcpy, strcat, and strcmp, found in <string.h>. In the following, s and t are char *s, and c and n are intact.

Whai is block structure???

C is not a block structure language in Tha sense of Pascal or similar language, because function may not be defined within other function. On the other hand, declarations of variables (including initializations) may follow the left brace that introduce any compound statement, not just the one that begins a function. Variable declared in this way hide any identically named variables in outer blocks, and remain in existence until the matching right brace. For example​, in If (n > o) { Int i; /* declare a new i */ For (i = o ; i < n ; i++) . . . }

How can we copying file in C language.

Image
Given getchar and putchar, you can write a surprising amount of useful code without knowing anything more about input and output. The simplest example is a program that copies it's input to it's output one character at a time

Wallpaper of iron man

Image

Arrays in C programming language

Image
Let us write a program to count the number of occurrences of each digit, or white space character (blank, tab, newline), and of all other characters. This is artificial, but it permits us to illustrate several aspects of C in one program. There are twelve categories of input, so it is convenient to use an array to hold the number of occurrence of each digit, rather than ten individual variables. Here is one version of the program:

About lunar eclipse

Image
2018. The moon will pass through the centre of the earth's shadow. This will be the first central lunar   eclipse since june 15, 2011. Since it will occur near apogee, this eclipse will also be the longest total lunar eclipse in the 21st   century. Totality will last approximately 103 minutes.