I have uploaded all my projects in C, C++, HTML, CSS, Java, and Android Development Projects in a topic-wise sequential manner.
Further posts are uploaded on https://mohitx001.blogspot.com/
# include <stdio.h> //With argument without return value void mohit ( int n ) { for ( int i = 1 ; i < n ; i ++) { printf ( "%c \n " , '*' ); //without return value } } int main () { mohit ( 5 ); //With argument return 0 ; }
package com.company ; public class Ch7_32_MethodOverloading { static void greet () { // no return type (void) with no parameters System . out . println ( "Hello, Nice to meet you" ); } static void add ( int x , int y ) { // void return with parameter x and y int z = x + y ; System . out . println ( "The addition of " + x + " and " + y + " is: " + z ); } static void func () { System . out . println ( "The function has no value in it." ); } static void func ( int x ) { System . out . println ( "The value in the function is : " + x ); } static void func ( int x , int y ) { System . out . println ( "The value in the function is : " + x + " " + y ); } static void func ( int x , int y , int x1 ) { System . out . println ( "The value in the function is : " + x + " " + y + " " + x1 ); ...
package com.company.Ch7_35_PracticeSet ; public class PS_Ch7_Q8 { static void pattern ( int n ) { if ( n > 0 ) { pattern ( n - 1 ); for ( int i = 0 ; i < n ; i ++) { System . out . print ( "*" ); } System . out . println (); } } public static void main ( String [] args ) { pattern ( 5 ); } }
Comments
Post a Comment