Skip to main content

Posts

Showing posts from March, 2017

Code A Clock And 'C'

The Clock Program For all the coders out there and those who are looking for crazy stuff in coding,this clock program is a brain riddle and gets you crazy enough. Have you ever tried writing a program that can display a classic clock that actually works?So,here it is. The clock that runs with "C". #include <stdio.h> #include <math.h> #include <stdlib.h> #include <time.h> struct hand{ int x; int y; }; int only_star; char getSymbol(int angle ); int main(int argc, char *argv[]) {     char plane[220][500];     int t,k,x,y,size,clck_x,clck_y,radius;     double  val = 3.14159 / 180; //Input the dimention of the clock. printf("Enter the size of the clock (max -> 200)(best visible at range 30-60) : "); scanf("%d",&size); printf("\nDo you want star symbol for hands (yes -> 1)(no -> 0) : "); scanf("%d",&only_star); //set the dementions of the clock layout. clck_x...

Code like a pro

#include<stdio.h> #include <unistd.h> main(){      char filename[] ;      char ch;      int speed;           printf("\n\nEnter the file name :  ");      scanf("%s",filename);      printf("\n\nEnter the Speed (in milli seconds) :  ");      scanf("%d",&speed);      printf("\n\n\n\n\n\n\n");           FILE *f = fopen(filename,"r");      while( (ch = getc(f)) != EOF){           printf("%c",ch);           usleep(10000*speed);           fflush(stdout);      }      fclose(f); } We all like to show off ourself in front of people and you...

JAVA progs-2

The Fibonacci sequence is defined by the following rule. The first 2 values in the sequence are 1, 1. Every subsequent value is the sum of the 2 values preceding it. Write a Java program that uses both recursive and non-recursive functions to print the nth value of the Fibonacci sequence. /*Non Recursive Solution*/ import java.util.Scanner; class Fib { public static void main(String args[ ]) { Scanner input=new Scanner(System.in); int i,a=1,b=1,c=0,t; System.out.println("Enter value of t:"); t=input.nextInt(); System.out.print(a); System.out.print(" "+b); for(i=0;i<t-2;i++) { c=a+b; a=b; b=c; System.out.print(" "+c); }  System.out.println(); System.out.print(t+"th value of the series is: "+c); } } Expected Input and output:  Enter the value of t: 5 1 1 2 3 5 Actual Input & Output :  For more info regarding technology and pro stuff...visit  http://peoplezmind.com/

JAVA progs-1

1.Write a Java program that prints all real solutions to the quadratic equation ax2 +bx+c = 0. Read in a, b, c and use the quadratic formula. If the discriminate b2 -4ac is negative, display a message stating that there are no real solutions import java.io.*; class Quadratic { public static void main(String args[])throwsIOException { double x1,x2,disc,a,b,c; InputStreamReader obj=new InputStreamReader(System.in); BufferedReader br=new BufferedReader(obj); System.out.println("enter a,b,c values"); a=Double.parseDouble(br.readLine()); b=Double.parseDouble(br.readLine()); c=Double.parseDouble(br.readLine()); disc= (b*b)-(4*a*c); if (disc==0) { System.out.println("roots are real and equal "); x1=x2=b/(2*a); System.out.println("roots are "+x1+","+x2); } else if(disc>0) { System.out.println("roots are real and unequal"); x1=(-b+Math.sqrt(disc))/(2*a); x2=(b+Math.sqrt(disc))/(2*a); System....

JNTUCEJ Cezar2k17 bike stunt-part 3

For more info regarding technology and pro stuff...visit  http://peoplezmind.com/

JNTUCEJ Cezar2k17 bike stunt-part 2

For more info regarding technology and pro stuff...visit  http://peoplezmind.com/

JNTUCEJ Cezar2k17 bike stunt-part 1

For more info regarding technology and pro stuff...visit  http://peoplezmind.com/