Posts

Functions in C

Image
##########  FUNCTION ######### what is function 1 Function is piece of code to accomplish any certain opration 2 it has a name for identification 3 Function are two types  . pre defined functions [ exapmle= clrscr(); ] . user defined function [ example= made by user like you can see in source code ] TERMS OF FUNCTION. . Function defenation ( funcation defenation are 4 types) 1. takes nothing returns nothing 2. takes something returns nothing 3. takes nothing returns something 4. takes something returns something  . function declaration ( function prototype ) you can read from source code.  . function call  -------------------------------- function run screen -------------------------------- **************** Source Code ***************** #include <stdio.h> #include <conio.h> void add( void );  // function declaration or prototype // void main() {     clrscr();     add(); // function call //   ...

Function [ takes nothing returns nothing ]

Image
_________________________________________ Takes nothing returns nothing [ function ] ------------------------------------------------------------------ . when function cannot takes or returns any type of data that is called   takes nothing returns nothing means { void }   . VOID = this keyword shows their has no data returns or takes  ------------------ run screen ------------------ $$$$$$$$$$$$$$ #include <stdio.h> #include<conio.h> void  add( void );  //  function declaration or prototype  // void  main() {     clrscr();     add(); //  function call  //     getch(); } void  add() //  function defenation  // { int  a,b,c; printf( "enter two number= " ); scanf( "%d %d" ,&a,&b); c=a+b; printf( "sum is [ %d ]" ,c); }       ####################### All rights goes to $[UB codes]$ ####################### <------------------------...

if else in C

Image
#----------------------# IF else code  #---------------------# x>y ? printf(" ") : printf(" ");  PROGRAM RUN  SCREEN  #####################         [  source code ] #include <stdio.h> #include <conio.h> main() { int x; clrscr(); printf( "\nThis program is made by[UB]to check number is positive or not" ); printf( "                                                     " ); printf( "                                              ...

Break in C

Image
* BREAK * B reak is use to end loop body | break;  | ------------------------------ Break run screen  ------------------------------ $ source code $ ################## #include <stdio.h> #include <conio.h> // code by [UB] // main() {     int i=i,x;     while (i<=5)     {         printf( "enter a number= " );         scanf( "%d" ,&x);         if (x<=0)             break ;         i++;     }     i==6 ? printf( "end normaly" ) : printf( "apply break" );     getch(); } ############################### *ALL RIGHTS GOES TO [UB CODES]*  \-----------------------------------------------------/

LOOPS

Image
* LOOPS* {loops are three types } &&&&&&&&&&&&&&& 1st = while  syntax while(variable<=5) { variable++ } &&&&&&&&&&&&&&&& 2nd= do while  syntax do  { variable++ } while(variable<=5); $$$$$$$$$$$$$$$$$$$$$$$ 3rd=for  [ mostly used by me ] syntax for(variable=1;variable<=5;variable++) { } --------------------------------------------- * PROGRAM RUN SCREEN * --------------------------------------------- # SOURCE CODE # ################ #include <stdio.h> #include <conio.h> // code [UB] // main() { int i=1; clrscr(); for (i=1;i<=1000000000000;i++) { printf( "\f😈hello motherfu***r😈" ); } getch(); } ################### *ALL RIGHTS GOES TO [UB CODES]* /-------------------------------------------------\

Switch in C

Image
SWITCH IN .C switch keyword is use to choose any one option   [syntax] switch(variable ) { } ----------------------------------------- swtch program run screen ------------------------------------------ s ource code  ################# #include <stdio.h> #include <conio.h> // code by [UB] // main() {     int choice,a,b,s;     clrscr();     while (1)     {         printf( "\n###################" );         printf( "\n1. add numbers" );         printf( "\n2. odd or even" );         printf( "\n3.  multiply  " );         printf( "\n4. devide     " );         printf( "\n5. About devloper" );         printf( "\n...