Posts

Showing posts from December, 2022

C (assign- 20-25) 🎆

meine apne prespective se question kiya toh koi or suggestion ho toh batana ankh khol kar likhna mein ankh band karke codes likhta hu u Q20.   //value #include <stdio.h> void swap ( int , int ); void main () {     int n1 , n2 ;     printf ( "Enter the two numbers to be swapped \n " );     scanf ( " %d%d " , & n1 , & n2 );     printf ( " \n Before Swap n1= %d n2= %d " , n1 , n2 );     swap ( n1 , n2 ); } void swap ( int n1 , int n2 ) {     int temp ;     temp = n1 ;     n1 = n2 ;     n2 = temp ;     printf ( " \n After Swap n1= %d n2= %d " , n1 , n2 ); } // ref.. #include <stdio.h> void swap1 ( int * num1 , int * num2 ); int main () {     int num1 , num2 ;     printf ( "Enter two numbers: " );     scanf ( " %d%d " , & num1 , & num2 );       printf ( " \n Before swap of num1 = %d num2 = %d \n " , num1 , num2 );     swap1 (& num1 , & num2 );     return 0 ; } voi

O.S. UNIT 5 (QUES/ANS)

 use at your own risk>>>mam ke agge mera naam mat le dean 1 >>what is virtual memory concept write the advantage virtual memory in a computer system.?  Virtual memory is a common technique used in a computer's operating system (OS). Virtual memory uses both hardware and software to enable a computer  to compensate for physical memory shortages, temporarily transferring data from random access memory (RAM) to disk storage. **Virtual memory helps to gain speed when only a particular segment of the program is required for the execution of the program. **It is very helpful in implementing a multiprogramming environment. **It allows you to run more applications at once. **It helps you to fit many large programs into smaller programs. **Common data or code may be shared between memory. 2>>  explain demand paging write the steps of demand paging? Demand paging is a process in which data is moved from secondary memory to RAM on a demand basis, which means all data is n

Assignment C Language 11-19 🎆

Image
CODE_HUB Yeh code VS code mein working hai (error aaye toh batana) 💟  This is me <3 Ou tput khudse kar lena (easy hai)   Q.11  Write a recursive function that will generate and print the first n Fibonacci number. Test the function for n=10 and n=15. Ans  #include <stdio.h> int fibonacci ( int f ); int main () {     int n , f = 0 , i ;     printf ( "Enter number" );     scanf ( " %d " , & n );     printf ( "Fibonacci series terms are:" );     for ( i = 1 ; i <= n ; i ++)     {         printf ( " %d " , fibonacci ( f ));         f ++;     }     return 0 ; } int fibonacci ( int n ) {     if ( n == 0 || n == 1 )         return n ;     else         return ( fibonacci ( n - 1 ) + fibonacci ( n - 2 )); } another way to direct print answer #include <stdio.h> int fib ( int n ) {     if ( n <= 1 )         return n ;     return fib ( n - 1 ) + fib ( n - 2 ); } int main () {     int n = 15 ;     pr