project2 - scanf("%d",&g); printf("Enter...

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
# include <stdio.h> # include <math.h> /*Declaring functions */ void task1(int n,int a,int i); main () { int e,t,o,u,g,h,d1,d2,b,c; /* t is the number entered by the use. */ /* a is check whether the remainder is 1 or 0. */ /* o is an empty number to put into the function. */ printf("----------------------Task 1---------------------------\n\n"); printf("Enter the value of the number:"); scanf("%d",&t); printf("\n"); task1( t,u,o) ; printf("\n"); printf("----------------------Task 2---------------------------\n\n "); printf("Enter the value of the first number :");
Background image of page 1
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: scanf("%d",&g); printf("Enter the value of the first number :"); scanf("%d",&h); l=0; k=0; do { for( (d1=g-1)&&(d2=h-1); d1>0 && d2>0; d1 -=1 && d -=1){ if (b=(g/d1) || c=(h/d2)) } } while(d1 != d2) scanf("%d", &e); } /*This is the function for the first task */ void task1(int n,int a,int i){ for(i=2; i<n; i++){ if(a=(n%i)) { continue; } else break; } printf("\n"); if(a>0) { printf("This is prime number\n"); } else { printf("This is not a prime number\n"); printf("\n"); } }...
View Full Document

This note was uploaded on 10/26/2011 for the course ECE 3331 taught by Professor Staff during the Fall '08 term at University of Houston.

Ask a homework question - tutors are online