Posts

FIBONACCI SERIES

************************************************************************  Write a c program to print Fibonacci series without using recursion and using recursion. Input: 10 Output: 0 1 1 2 3 5 8 13 21 34 ************************************************************************  JAVA Program //import java.util.Date; import java.util.Scanner; public class HelloWorld {     public static void main(String[] args) {         // Date now = new Date();         Scanner sc= new Scanner(System.in);         int x,y,z,n,i;         y=z=0;         x=1;         System.out.println("Enter value of n: ");         n=sc.nextInt();         System.out.println("FIBONACCI SERIES: " );     ...

PROGRAMS

  C programs are frequently asked in the interview. These programs can be asked from basics, array, string, pointer, linked list, file handling etc. Let's see the list of c programs. 2) Prime number Write a c program to check prime number. Input: 44 Output: not prime number Input: 7 Output: prime number 3) Palindrome number Write a c program to check palindrome number. Input: 329 Output: not palindrome number Input: 12321 Output: palindrome number 4) Factorial Write a c program to print factorial of a number. Input: 5 Output: 120 Input: 6 Output: 720 5) Armstrong number Write a c program to check armstrong number. Input: 153 Output: armstrong Input: 22 Output: not armstrong 6) Sum of Digits Write a c program to print sum of digits. Input: 234 Output: 9 Input: 12345 Output: 15 7) Reverse Number Write a c program to reverse given number. Input: 123 Output: 321 8) Swap two numbers without using third variable Write a c ...

HELLO WORLD PROGRAM

************************************************************************  W.A.P TO PRINT "HELLO WORLD!" ************************************************************************  JAVA Program class  Simple{        public   static   void  main(String args[]){        System.out.println( "Hello Java" );       }   }    Save the above file as Simple.java. To compile: javac Simple.java To execute: java Simple           Online compiler Output: Hello Java ************************************************************************  C Program #include <stdio.h> int main() { printf("Hello World!"); } Save the above file as Simple.C. Compile and Run it. Online Compiler   Output Hello, World!   ************************************************************************  C++ Progra...