Daily Archives: October 5, 2015


#include<stdio.h> int main() { int a, b, x, y, t, gcd, lcm; printf(“Enter two integers\n”); scanf(“%d%d”, &x, &y); a = x; b = y; while (b != 0) { t = b; b = a % b; a = t; } gcd = a; lcm = (x*y)/gcd; printf(“Greatest common divisor […]

program of find the HCM and LCM


#include<stdio.h> int main() { int c, n, fact = 1; printf(“Enter a number to calculate it’s factorial\n”); scanf(“%d”, &n); for (c = 1; c <= n; c++) fact = fact * c; printf(“Factorial of %d = %d\n”, n, fact); return 0; }

Program of factorial


1
#include<stdio.h> int main() { int first, second, add, subtract, multiply; float divide; printf(“Enter two integers\n”); scanf(“%d%d”, &first, &second); add = first + second; subtract = first – second; multiply = first * second; divide = first / (float)second; //typecasting printf(“Sum = %d\n”,add); printf(“Difference = %d\n”,subtract); printf(“Multiplication = %d\n”,multiply); printf(“Division = […]

C program to perform addition, subtraction, multiplication and division




1
#include<stdio.h>   int main() { int a, b, c;   printf("Enter two numbers to add\n"); scanf("%d%d",&a,&b);   c = a + b;   printf("Sum of entered numbers = %d\n",c);   return 0; } Output: Enter two numbers to add 4 5 Sum of entered numbers = 9

Addition of Two numbers





june 2012 ugc net p2 q18
The postfix expression AB+CD–* can be evaluated using a (A) stack            (B) tree (C) queue         (D) linked list Answer: A The post order traversal of a binary tree is DEBFCA. Find out the preorder traversal. (A) ABFCDE                 (B) ADBFEC (C) ABDECF                (D) None of the above Answer: C The branch […]

NET JUNE 2012 PAPER-2 SOLVED