e-LEARNING ZONE | Indian Shout

You are here: » Category » e-LEARNING ZONE

C PROGRAM TO ACCEPT STRING & SUBSTRING AND CHECK SUBSTRING PRESENT IN STRING OR NOT

Posted by 1 Response

/* Write a C program to accept a string and a substring and check if the substring is present in the given string */ #include<stdio.h> #include<conio.h> void main() { char str[80],search[10];     int count1=0,count2=0,i,j,flag; clrscr(); puts("Enter a string:"); gets(str); puts("Enter search substring:"); gets(search); while (str[count1]!='\0') count1++; while (search[count2]!='\0') ... [ Continue reading... ]

May
14
2010

C PROGRAM TO ACCEPT AN INTEGER AND REVERSE IT

Posted by 0 Responses

/* Write a C program to accept an integer and reverse it */ #include <stdio.h> void main() { long  num, rev = 0, temp, digit; printf("Enter the number\n");  /*For better programming,choose 'long int' */ scanf("%ld", &num); temp = num; while(num > 0) { digit = num % 10; rev = rev * 10 + digit; num /= 10; } printf("Given number   = %ld\n", temp); printf("Its reverse is = %ld\n",... [ Continue reading... ]

May
14
2010

C PROGRAM TO INSERT A PARTICULAR ELEMENT IN A SPECIFIED POSITION IN GIVEN ARRAY

Posted by 0 Responses

/* Write a C program to insert a particular element in a specified position  in a given array   */ #include <stdio.h> #include <conio.h> void main() { int  x[10]; int  i, j, n, m, temp, key, pos; clrscr(); printf("Enter how many elements\n"); scanf("%d", &n); printf("Enter the elements\n"); for(i=0; i<n; i++) { scanf("%d", &x[i]); } printf("Input array elements are\n"); for(i=0;... [ Continue reading... ]

May
14
2010

C PROGRAM TO ACCEPT N INTEGERS AND STORE THEM IN AN ARRAY

Posted by 1 Response

/* Program to accept N integer number and store them in an array AR. * The odd elements in the AR are copied into OAR and other elements * are copied into EAR. Display the contents of OAR and EAR */ #include <stdio.h> void main() { long int ARR[10], OAR[10], EAR[10]; int i,j=0,k=0,n; printf("Enter the size of array AR\n"); scanf("%d",&n); printf("Enter the elements of the array\n"); for(i=0;i<n;i++) { ... [ Continue reading... ]

May
14
2010

C PROGRAM TO CONVERT BINARY NUMBER TO DECIMAL

Posted by 1 Response

/* Write a C program to convert the given binary number into decimal */ #include <stdio.h> void main() { int   num, bnum, dec = 0, base = 1, rem ; printf("Enter a binary number(1s and 0s)\n"); scanf("%d", &num);           /*maximum five digits */ bnum = num; while( num > 0) { rem = num % 10; dec = dec + rem * base; num = num / 10 ; base = base * 2; } printf("The Binary number is =... [ Continue reading... ]

May
13
2010

JNTU B.TECH C LAB PROGRAMS

Posted by 0 Responses

JNTU B.TECH C LAB PROGRAMS   CLICK HERE TO DOWNLOAD C- Programs for... [ Continue reading... ]

Apr
25
2010

C PROGRAM TO PERFORM ADDITION,SUBTRACTION,MULTIPLICATION,DIVISION,REMAINDER USING SWITCH STATEMENT

Posted by 0 Responses

/* Write a C program, which takes two integer operands and one operator form the user, performs the operation and then prints the result. (Consider the operators +,-,*, /, % and use Switch Statement)*/ #include<stdio.h> #include<conio.h> void main() { int a,b,res,ch; clrscr(); printf("\t  ... [ Continue reading... ]

Apr
25
2010

C PROGRAM TO FIND GCD OF 2 INTEGERS USING RECURSIVE AND NON-RECURSIVE

Posted by 0 Responses

/* Write C programs that use both recursive and non-recursive functions To find the GCD (greatest common divisor) of two given integers.*/ #include<stdio.h> #include<conio.h> #include<math.h> unsigned int GcdRecursive(unsigned m, unsigned n); unsigned int GcdNonRecursive(unsigned p,unsigned q); int main(void) { int a,b,iGcd; clrscr(); printf("Enter the two numbers whose GCD is to be found: "); ... [ Continue reading... ]

Apr
25
2010

C PROGRAM TO FIND FACTORIAL OF A INTEGER USING RECURSIVE AND NON-RECURSIVE FUNCTIONS

Posted by 0 Responses

/* Write C programs that use both recursive and non-recursive functions .To find the factorial of a given integer.*/ #include<stdio.h> #include<conio.h> unsigned int recr_factorial(int n); unsigned int iter_factorial(int n); void main() { int n,i; long fact; clrscr(); printf("Enter the number: "); scanf("%d",&n); if(n==0) printf("Factorial of 0 is 1\n"); else { printf("Factorial of %d Using... [ Continue reading... ]

Apr
25
2010

C PROGRAM TO FIND THE ROOTS OF A QUADRATIC EQUATION

Posted by 0 Responses

/* Write a C program to find the roots of a quadratic equation. */ #include<stdio.h> #include<conio.h> #include<math.h> void main() { float a,b,c,root1,root2; clrscr(); printf("\n Enter values of a,b,c for finding roots of a quadratic eq:\n"); scanf("%f%f%f",&a,&b,&c); /*checking condition*/ if(b*b>4*a*c) { root1=-b+sqrt(b*b-4*a*c)/2*a; root2=-b-sqrt(b*b-4*a*c)/2*a; printf("\n*****ROOTS... [ Continue reading... ]

Apr
25
2010

C PROGRAM TO FIND THE SUM OF INDIVIDUAL DIGITS OF A POSITIVE INTEGER

Posted by 0 Responses

/* Write a C program to find the sum of individual digits of a positive integer.*/ #include<stdio.h> #include<conio.h> void main() { int num, k=1, sum=0; clrscr(); printf("Enter the number whose digits are to be added:"); scanf("%d",&num); while(num!=0) { k=num%10; sum=sum+k; k=num/10; num=k; } printf("Sum of the... [ Continue reading... ]

Apr
25
2010

C PROGRAM TO GENERATE PRIME NUMBERS BETWEEN 1 AND N

Posted by 4 Responses

/* Write a C program to generate all the prime numbers between 1 and n, where n is a value supplied by the user. */ #include <stdio.h> void main() { int no,counter,counter1,check; clrscr(); printf("<-----------------------PRIME NO. SERIES------------------------>"); printf("\n\n\n\t\t\tINPUT THE VALUE OF N: "); scanf("%d",&no); printf("\n\nTHE PRIME NO. SERIES B/W 1 TO %d : \n\n",no); for(counter = 1; counter... [ Continue reading... ]

Apr
25
2010

C PROGRAMS : FIBONACCI SEQUENCE

Posted by 1 Response

/* A Fibonacci Sequence is defined as follows: the first and second terms in the sequence are 0 and 1. Subsequent terms are found by adding the preceding two terms in the sequence. Write a C program to generate the first n terms of the sequence. */ #include <stdio.h> void main() { int num1=0, num2=1,no,counter,fab; clrscr(); printf("<===========PROGRAM TO FIND THE FIBONACCI SERIES UP TO N NO. IN... [ Continue reading... ]

Apr
25
2010

JNTU MEFA ALL 8 UNITS FULL NOTES AND MATERIAL

Posted by 1 Response

JAWAHARLAL NEHRU TECHNOLOGICAL UNIVERSITY HYDERABAD MANAGERIAL ECONOMICS AND FINANCIAL ANALYSIS FULL 8 UNITS NOTES AND FULL STUDY MATERIAL   CLICK HERE TO DOWNLOAD JNTU MEFA NOTES AND... [ Continue reading... ]

Apr
25
2010
 
Search
Free Email Updates
Get All Latest Updates in Ur e-mail Inbox..

And then confirm your email subcription

Free SMS Alerts
Sponsored Links
Copy Protected by Chetans WP-Copyprotect.