Posts

Showing posts from August, 2020

[FUNCTION] takes something return something

Image
------------------- FUNCTION -------------------   [ Takes something Return Something ] . when a function takes some data to done it's work and also return data it is called as   Takes something Return Something ^^^^^^^^^^^^^^^  RUN SCREEN  $$$$$$$$$$$$$$ $ SOURCE CODE $ #############  #include <stdio.h> #include <conio.h> //[ UB CODES ] // int add( int , int ); int main() {     int x,y,s;     clrscr();     printf( "enter two number= " );     scanf( "%d %d" ,&x,&y);     s=add(x,y);     printf( "sum is=[ %d ]" ,s);     getch(); } int add( int a, int b) {     int c;     c=a+b;     return (c); } ######################### ALL RIGHTS GOES TO [ UB CODE ] ######################### <---------------------------------------------------->

[FUNCTION] takes nothing return something

Image
--------------------- FUNCTION --------------------- [ Takes nothing return something  ] . When function don't takes any data and return something it called as  Takes nothing return something    ########### RUN SCREEN ########### ^^^^^^^^^^^^^^^^^^^  $  source code $ #include <stdio.h> #include <conio.h> // takes nothing return something // //code by UB // int add( void ); void main() { int x; clrscr(); x=add(); printf( "sum is %d" ,x); getch(); } int add() { int c,a,b; printf( "enter two number= " ); scanf( "%d %d" ,&a,&b); c=a+b; return (c); } ########################### &ALL RIGHTS GOES TO [UB CODES]$ ########################### <--------------------------------------------------------->

[Function] Takes something return nothing

Image
------------------- FUNCTION ------------------- [ Takes something return nothing ] . when a function takes some data but don't return . it is called as takes something return nothing Run screen  ******************* SOURCE CODE ******************* #include <stdio.h> #include <conio.h> // takes something return nothing // //code by UB // void add( int , int ); void main() { int x,y; clrscr(); printf( "enter two number= " ); scanf( "%d %d" ,&x,&y); add(x,y); //actual argument [ call by value ] // getch(); } void add( int a, int b) // formal argument // { int c; c=a+b; printf( "sum is [%d]" ,c); } ######################### ALL RIGHTS GOES TO [UB CODES] ######################### <--------------------------------------------------->

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...