switch case program example output in c

c program for egg game

switch case program example output in c   What would be the output of the following programs: main( ) { int k, j = 2 ; switch ( k = j + 1 ) { case 0 : printf ( “\nTailor”) ; case 1 : printf ( “\nTutor”) ; case 2 : printf ( “\nTramp”) … Read more

switch case what would be the output of the program

c program for egg game

switch case what would be the output of the program main( ) { int k, j = 2 ; switch ( k = j + 1 ) { case 0 : printf ( “\nTailor”) ; case 1 : printf ( “\nTutor”) ; case 2 : printf ( “\nTramp”) ; default : printf ( “\nPure Simple … Read more

conditional operators c program example

c program for egg game

conditional operators c program example         What would be the output of the following programs: main( ) { int k, num = 30 ; k = ( num > 5 ? ( num <= 10 ? 100 : 200 ) : 500 ) ; printf ( “\n%d”, num ) ; }   … Read more

C Program to print half pyramid using alphabets

C Programming Tutorial

C Program to print half pyramid using alphabets A B B C C C D D D D E E E E E Let’s see the program code #include <stdio.h> int main() { int i, j; char input, alphabet = ‘A’; printf(“Enter the uppercase character you want to print in last row: “); scanf(“%c”,&input); for(i=1; … Read more

Program to print half pyramid using *

c program for egg game

Program to print half pyramid using *   * * * * * * * * * * * * * * * #include <stdio.h> int main() { int i, j, rows; printf(“Enter number of rows to print: “); scanf(“%d”,&rows); for(i=1; i<=rows; ++i) { for(j=1; j<=i; ++j) { printf(“* “); } printf(“\n”); } return 0; … Read more

Hello Word – First C program

C Programming Tutorial

Hello Word – First C program #include <stdio.h> int main() { // printf() displays the string inside quotation printf(“Hello, World!”); return 0; } Lets understand “Hello, World!” program The #include <stdio.h> is a pre processor command. This command tells compiler to include the contents of stdio.h (standard input and output) file in the program. The stdio.h file contains functions such as scanf() and print() to take … Read more