C SOURCE CODE

1.      Write a program to find whether the given character is vowel or consonant

Vowel or Consonant:

#include<stdio.h>
void main()
{
char ch;
clrscr();
printf("\n enter the character:");
scanf("%c",&ch);
if((ch>=65&&ch<=122))
{
if((ch=='a')||(ch=='e')||(ch=='i')||(ch=='o')||(ch=='u'))
printf("\n given is characteris vowel");
else
printf("\n enter character  is consonant");
}
else
printf("\n please enter the character:");
}

Output:

Enter the character: a
Given is character is vowel

Enter the character:
Please enter the character:

Enter the character: r
Enter character is consonant


















2.      Write a program to implement all arithmetic operations (+ , -, * , / , %). Using Switch Statement
(+ , -, * , / , %)
#include<stdio.h>
main()
{
int a,b,opt;
clrscr();
printf(“Enter A and B valves:”);
scanf(“%d%d”,&a,&b);
printf("1. Addition\n 2.Subtraction \n 3. Multiplication \n 4. Division \n 5. modules:");
printf("Enter ur option:");
scanf("%d",&opt);
switch(opt)
{
case 1:
printf("\n Addition is %d+%d=%d",a,b,a+b);
break;
case 2:
printf("\n subtraction is %d-%d=%d",a,b,a-b);
break;
case 3:
printf("\n multiplication is %d*%d=%d",a,b,a*b);
break;
case 4:
printf("\n division is %d/%d=%d",a,b,a/b);
break;
case 5:
printf("\n modules is %d and %d=%d",a,b,(a%b));
default:
printf("Invalid option");
}

Output:
Enter A and B values: 20 10
1. Addition
2. Subtraction
3. Multiplication
4. Division
5. Modules
Enter your option:1
Addition of 20 and 10 is: 30

Enter A and B values: 20 10
1. Addition
2. Subtraction
3. Multiplication
4. Division
5. Modules
Enter your option:2
subtraction of 20 and 10 is: 10
Enter A and B values: 20 10
1. Addition
2. Subtraction
3. Multiplication
4. Division
5. Modules
Enter your option:3
multiplication of 20 and 10 is: 200




Enter A and B values: 20 10
1. Addition
2. Subtraction
3. Multiplication
4. Division
5. Modules
Enter your option:4
Division of 20 and 10 is: 2

Enter A and B values: 20 10
1. Addition
2. Subtraction
3. Multiplication
4. Division
5. Modules
Enter your option:4
Division of 20 and 10 is: 0

















3. Program to check  given number is  strong or not
#include <stdio.h>
Main()
{
Int i,n,r,f,d,sum=0;
Printf(“enter n value”);
Scanf(“%d”,&n);
D=n;
While(n!=0)
{
R=n%10;
For(i=r,f=1;i>=1;i--)
F=f*I;
Sum=sum+f;
N=n/10;
}
If(sum==d)
Printf(“%d is  strong”,d);
Else
Printf(“%d is not strong”);
}



Output:

Enter  n value: 145
145strong





4. Program to check given no is prime or not

Prime or not
#include <stdio.h>
main()
{
int n,i,s=0;
clrscr();
printf("\n enter n value:");
scanf("%d",&n);
for(i=1;i<=n;i++)
if(n%i==0)
s=s+1;
if(s==2)
printf("\n prime:");
else
printf("\n not prime:");
getch();
}


Output:
Enter  n value  : 23
Given number is prime.

Enter n value :5
Given number is prime

Enter  n value :11
Given number  is prime










5. program check whether no is palindrome or not

Palindrome or not

#include<stdio.h>
main()
{
int n,r,sum=0,d;
clrscr();
printf("\n enter n value:");
scanf("%d",&n);
d=n;
while(n!=0)
{
r=n%10;
sum=sum*10+r;
n=n/10;
}
if(d==sum)
printf("\n given no is %d is paliendrome:",d);
else
printf("\n given no is not pailndrome:",sum);
}


Output:

Enter n value: 121
121   is   palindrome


Enter  n value :203
203 is  palindrome


Enter  n  value: 333

333 is palindrome.

Enter n value : 151
151 is  palindrome







6. program  to find whether the given number is perfect or not

perfect or not
#include<stdio.h>
main()
{
int i,n,sum=0;
clrscr();
printf("\n enter n”);
scanf(“%d”,&n);
for(i=1;ni<=n-1;i++)
if(n%i==0)
sum=sum+I;
if(sum==n)
printf(“%d is perfect”,n);
else
printf(“%d is not perfect”,n);
}



Enter  n value: 6
6 is  perfect


Enter  n value  :28
28  is   perfect

Enter  n value  :496

496  is  perfect


Enter n value:8
8 is not perfect














7.  program print nth multiplication table

#include<stdio.h>
main()
{
int n,i;
clrscr();
printf("\n enter n value:");
scanf("%d",&n);
for(i=1;i<=10;i++)
printf("\n %d*%d=%d",n,i,(n*i));
}


Output:
Enter  n value: 4

4*1=4
4*2=8
4*3=12
4*4=16
4*5=20
4*6=24
4*7=27
4*8=32
4*9=36
4*10=40




















8. print armstrong numbers below 1000

Armstrong numbers
#include<stdio.h>
main()
{
int n,i,r,sum,d;
clrscr();
printf("\n armstrong below 1000:");
for(i=0;i<1000;i++)
{
sum=0;
d=i;
n=i;
while(n!=0)
{
r=n%10;
sum=sum+(r*r*r);
n=n/10;
}


Output:

1
153
370
371
407



9. Program  to print   perfect  number  below  1000

perfect  number  below  1000

#include <stdio.h>
Main()
{
Int  I,n,sum;
Printf(“1 to 1000  perfect number”);
For(n=0;n<1000;n++)
{
Sum=0;
For(i=1;i<=n-1;i++)
If(n%i==0)
Sum=sum+I;
If(sum==n)
Printf(“%d\t”,n);
}
}



Output:

6          28        496
























10. program to print below 1000 odd numbers

#include<stdio.h>
main()
{
int i;
clrscr();
printf("\n odd no below 1000:");
for(i=1;i<1000;i++)
if(i%2!=0)
printf("%d\t",i);
}






Output:

1          3          5          7          11        13        17        19        21        23        25        29        31


33        35        37        41        43        47        51        53        57        59        61        63        67

69        71        73        75        79        81        83        85        87        91        93        95        97
99        101






















11. program print the following format
1
2  3
4  5  6
7  8  9  10
11 12 13 14 15

#include<stdio.h>
main()
{
int n,i,j,sum;
clrscr();
printf("\n how many rows do u want:");
scanf("%d",&n);
sum=1;
for(i=1;i<=n;i++)
{
for(j=1;j<=i;j++)
printf("\t%d",sum++);
printf("\n");
}
}



Output:


1

2          3

4          5          6

7          8          9          10

11        12        13        14        15





12. Program to print  the following format
A
B          C
D         E          F
G         H         I           J
K         L          M         N         O

#include <stdio.h>
Main()
{
Int I,j,n,sum=65;
Printf(“no of  rows”);
Scanf(“%d”,&n);
For(i=1;i<=n;i++)
{
For(j=1;j<=I;j++)
Printf(“%c”,sum++);
Printf(“\n”);
}
}


Output:
A
B          C
D         E          F
G         H         I           J
K         L          M         N         O


13. Write program to find factorial of a  given number using recursions


#include<stdio.h>
Void main()
{
Int n;
Printf(“enter n”);
Scanf(“%d”,&n);
Printf(“factorial of %d is %d”,n,fact(n));
}
Int fact(int n)
{
If((n==0)||(n==1))
Return 1;
Else
Return(n*fact(n-1));
}


Output:

Enter n    5
Factorial of 5 is 120
Enter n  2
Factorial of 2 is 2



14. Write a program to  print Fibonacci series using recursions


#include<stdio.h>
void main()
{
int ft=0,st=1,n;
clrscr();
printf("enter n");
scanf("%d",&n);
printf("Fibnocci series\n");
printf("%5d%5d",ft,st);
fibo(ft,st,n);
}
fibo(int ft,int st,int n)
{
int tt=ft+st;
if(tt<=n)
{
printf("%5d",tt);
fibo(st,tt,n);
}
}



Output:

Enter n
5
Fibonacci series:
0   1   1    2     3    5
2.enter n
8
Fibonacci series:
0    1    1     2    3   5     8



15. Write a program to add two numbers using recursions
#include<stdio.h>
void main()
{
int a,b;
printf("enter a,b");
scanf("%d%d",&a,&b);
printf("sum of %d and %d is %d",a,b,sum(a,b));
}
int sum(int a,int b)
{
if(b==0)
return a;
else
sum(a+1,b-1) ;
}


OUTPUT:
1.  Enter a,b
231
569
Sum of 231 and 569 is 800
2.  Enter a,b
6
9
Sum of 6 and 9 is 15
3.  enter a,b
6
0
Sum of 6 and 0 is 6



16. Write a program to find whether the given string is palindrome or not
#include<stdio.h>
void main()
{
char st1[10],st2[10];
printf("enter a string");
gets(st1);
strcpy(st1,st2);
if(strcmp(st1,strrev(st2)==0))
printf("given string is palindrome");
else
printf("given string is not palindrome");
}

output:

1.enter a string
Malayalam
Given string is palindrome
2.enter a string
Teacher
Given string is not palindrome



























17. Write a program to perform all string handling functions

#include<stdio.h>
void main()
{
char st[10],st1[10],st2[10];
clrscr();
printf("enter a string");
gets(st);
printf("enter a string");
gets(st1);
printf("\n string comparision is");
if(strcmp(st,st1)==0)
printf("two strings are equal");
else
if(strcmp(st,st1)>0)
printf("%s is big",st);
else
printf("%s is big",st1);
printf("\n length of string is %d",strlen(st));
printf("\nucase of string is %s",strupr(st));
printf("\nlcase of string is %s",strlwr(st));
strcpy(st2,st);
printf("\n copy of first string is %s",st2);
printf("\nconcatenation of a stirng is %s",strcat(st2,st1));
printf("\nreverse of string is %s",strrev(st));
}


Output:



















18. Write a program to print sum of array

#include <stdio.h>
main()
{
int a[10],i,n,sum=0;
printf("enter array size");
scanf("%d",&n);
printf("enter elements into array);
for(i=0;i<=(n-1);i++)
{
scanf("%d",&a[i]);
sum=sum+a[i];
}
printf("sum of given arrray elements is %d”,sum);
}


1 .  Enter array size
5
Enter elements into array
1
2
3
4
5
Sum of given array elements is 15
2. Enter array size
4
Enter elements into array
10
20
30
40
Sum of given array elements is 100














19. Write a to serach an element in an array using linear search

. #include <stdio.h>
main()
{
int a[10],i,n,sr;
printf("enter array size");
scanf("%d",&n);
printf("enter elements in an array");
for(i=0;i<=(n-1);i++)
scanf("%d",&a[i]);
printf("enter element to be search");
scanf("%d",&sr);
for(i=0;i<=(n-1);i++)
if(a[i]==sr)
{
printf("%d is found at position",sr,i+1);
break;
}
if(i==n)
printf("%d is not found",sr);
}_


OUTPUT:
1.Enter array size
5
Enter elements into array
10
12
14
16
18
Enter element to search
16
16 is found at position 4
1.      Enter array size
3
Enter elements into array
50
60
40
Enter element to search 80
80 is not found





21. Write program to perform matrix multiplication using function

#include <stdio.h>
main()
{
int a[10][10], b[10][10],c[10][10],m,n,p,q;
clrscr();
printf("  enter size of matrix A");
scanf("%d%d",&m,&n);
printf("enter size of matrix B");
scanf("%d%d",&p,&q);
if(n==p)
{
printf("   enter element into matrix A");
readmatrix(a,m,n);
printf("enter  element into matrix B");
readmatrix(b,p,q);
matmul(a,b,c,m,n,q);
printf("elements in A:\n");
printmatrix(a,m,n);
printf("elements in B:\n");
printmatrix(b,p,q);
printf(”Multiplication of A and B is:\n");
printmatrix(c,m,q);
}
else
printf("matrix multiplication is not possible");
}
readmatrix(int x[10][10],int m,int n)
{
int i,j;
for(i=0;i<m;i++)
for(j=0;j<n;j++)
scanf("%d",&x[i][j]);
}
matmul(int x[10][10],int y[10][10],int z[10][10],int m,int n,int q)
{
int i,j,k;
for(i=0;i<m;i++)
for(j=0;j<q;j++)
{
z[i][j]=0;
for(k=0;k<n;k++)
z[i][j]=z[i][j]+x[i][k]*y[k][j];
}
}
printmatrix(int x[10][10],int m,int n)
{
int i,j;
for(i=0;i<m;i++)
{
for(j=0;j<n;j++)
printf("%5d",x[i][j]);
printf("\n");
}
}




OUTPUT  :
Enter size of matrix A
2        2
Enter size of matrix B
2 3
Enter elements into matrix A_
1
2
3
4
Enter elements into matrix B
5
6
7
8
9
10
Elements in A:
1                    2
2                    4
Elements in B:
5      6    7
8      9    10
Multiplication of A and B matrix is:
21     24    27
47     54    61
Enter size of matrix A 2 2
Enter size of matrix B 3 2
Matrix multiplication is not possible






22. program to perform addition of two matrices using function

#include <stdio.h>
main()
{
int a[10][10],b[10][10],c[10][10],m,n,p,q;
printf("enter size of matrix A");
scanf("%d%d",&m,&n);
printf("enter size of matrix B");
scanf("%d%d",&p,&q);
if((m==p)&&(n==q))
{
printf("enter elements in A");
readmatrix(a,m,n);
printf("enter elements in B");
readmatrix(b,p,q);
matadd(a,b,c,m,n);
printf("elements in A:\n");
printmatrix(a,m,n);
printf("elements in B:\n");
printmatrix(b,p,q);
printf("Multiplication of A and B :\n");
printmatrix(c,m,n);
}
else
printf("add is not possible");
}
readmatrix(int x[10][10],int m,int n)
{
int i,j;
for(i=0;i<m;i++)
for(j=0;j<n;j++)
scanf("%d",&x[i][j]);
}
matadd(int x[10][10],int y[10][10],int z[10][10],int m,int n)
{
int i,j;
for(i=0;i<m;i++)
for(j=0;j<n;j++)
{
z[i][j]=x[i][j]+y[i][j];
}
}







printmatrix(int x[10][10],int m,int n)
{
int i,j;
for(i=0;i<m;i++)
{
for(j=0;j<n;j++)
printf("%5d",x[i][j]);
printf("\n");
}
}











OUTPUT :

1.      Enter size of matrix A 2 2
Enter size of matrix B 2 2
Enter elements in A
1
2
3
4

5
9
2
4
Elements in A:
1                2
2                4
Elements in B:
5    9
3                4
Addition of A and B:
6        11
5        8




23.  Write  a program to create student structure and the members of a student
struct student
{
int sno;
char sname[10];
};
void main()
{
struct student  s[10];
int i,n;
clrscr();
printf("enter no.of students");
scanf("%d",&n);
printf("enter studentnumber and studentname");
for(i=0;i<n;i++)
scanf("%d%s",&s[i].sno,s[i].sname);
printf("students information is:\n");
for(i=0;i<n;i++)
printf("\n %d %s",s[i].sno,s[i].sname);
}



Enter  no of  students :3
Enter studentno and  studentname:
101  varun
102  deepthi
103   manoj
Student information is :
101      varun
102      deepthi

103      manoj
Read more

BASIC C PROGRAMS LIST

C PROGRAMS LIST

STARTING PROGRAMS:


1. Write a C program to print “hai how are you”.
2. Write a C program to print Leave Letter.
3. Write a C program to print names of students in a class line by line.


PROGRAMS ON CONSTANTS AND VARIABLE AND DATA TYPES:


1. Write a C program to illustrate use of INT data types.
2. Write a C program to illustrate use of FLOAT data types.
3. Write a C program to illustrate use of DOUBLE data types.
4. Write a C program to illustrate use of CHAR data types.
5. Write a C program to declare and initialize a variable.


PROGRAMS ON OPERATORS AND EXPRESSIONS:


1. Write a C Program on arithmetic operators.
2. Write a C Program on logical operators.
3. Write a C Program on relational operators.
4. Write a C Program on conditional operators.
5. Write a C Program on assignment operators.
6. Write a C Program on increment & decrement operators.
7. Write a C Program on bitwise operators.
8. Write a C Program on special operators.
9. Write a C Program on operators by using different data types.
10. Write a C Program on expression evaluation (BODMAS).
11. Write a C program to calculate Current Bill.
12. Write a C program to calculate total average.
13. Write a C program to calculate SI (simple interest).
14. Write a C program to calculate area of circle, rectangle, triangle, square etc. 
15. Write a C Program to calculate roots of quadratic equation.
16. Write a C program to sort given two numbers using third variable.
17. Write a C program to find given year is leap year or not.
18. Write a C program to find biggest of given three numbers.
19. Write a C program to find second biggest of given three numbers.




PROGRAMS ON DECISSION STATEMENTS:


1. Write a C program on simple IF.
2. Write a C program on IF ELSE.
3. Write a C program on NESTED IF.
4. Write a C program on simple IF ELSE LADDER.
5. Write a C program on GOTO.
6. Write a C program on CONDITIONAL OPERATOR.
7. Write a C program on SWITCH.
8. Write a C program to check the person eligible for voting or not.
9. Write a C program to give grade according to given percentage.
10. Write a C program to check whether given letter is vowel or consonant (IF).
11. Write a C program to check whether given letter is vowel or consonant (SWITCH).
12. Write a C program to check + ve or –ve number.
13. Write a C program to check even or odd.
14. Write a C program to check prime or not.
15. Write a C program to prepare calculator application.
16. Write a C program to prepare area application.


PROGRAMS ON LOOPS:


1. Write a C program to illustrate use of FOR loop.
2. Write a C program to illustrate use of WHILE loop.
3. Write a C program to illustrate use of DOWHILE loop.
4. Write a C program to illustrate difference between WHILE & DOWHILE.
5. Write a C program to find factorial of given number.
6. Write a C program to find prime numbers between 1-100.
7. Write a C program to find given number is Armstrong number or not.
8. Write a C program to find given number is strong number or not.
9. Write a C program to find given number is perfect number or not.
10. Write a C program to find reverse of a given number.
11. Write a C program to find given number is palindrome or not.
12. Write a C program to print Fibonacci series up to given number.
13. Write a C program to print even numbers between 1-100.
14. Write a C program to print odd numbers between 1-100.





PROGRAMS ON ARRAYS:


1. Write a C program to illustrate usage of arrays.
2. Write a C program to declare and initialize one dimensional array.
3. Write a C program to declare and initialize one dimensional array (int.float.char.double).
4. Write a C program to initialize and print elements in array.
5. Write a C program to initialize and print elements in array in reverse order.
6. Write a C program to find an element in array.
7. Write a C program to sort given elements in an array in ascending order.
8. Write a C program to sort given elements in an array in descending order.
9. Write a C program to declare and initialize two dimensional arrays.
10. Write a C program to perform matrix addition.
11. Write a C program to perform matrix multiplication.
12. Write a C program to illustrate usage of string array.
13. Write a C program to illustrate usage of gets() puts().
14. Write a C program to illustrate usage of all string handling functions.
15. Write a C program to check string palindrome or not.


PROGRAMS ON USER DEFINED FUNCTIONS:

1. Write a C program to illustrate usage of user defined functions.
2. No arguments no returns.
3. No arguments with returns.
4. With arguments and no returns.
5. With arguments and with returns.
6. Write a C program to illustrate usage recursion (factorial).


PROGRAMS ON POINTERS:

1. Write a C program to illustrate usage of pointers in C.


PROGRAMS ON STRUCTURES AND UNIONS:

1. Write a C program to illustrate the usage of structures and unions.

Read more

OFF CAMPUS DRIVE AT HYDERABAD FOR GOOGLE MAPS

                          SERCO HIRING FOR GOOGLE

COMPANY NAME : GOOGLE
INTERVIEW CONDUCTED BY: SERCO

DATE: 03/09/2013

QUALIFICATION: ANY GRADUATE OR POST GRADUATE

SALARY: 2.3 LPA

VENUE: NISHITHA COLLEGE

FOR MORE DETAILS: www.nishitha.in
Read more

IBM(TECH SUPPORT) OFF AT VIJAYAWADA ON 7/092013

               GREAT OPPORTUNITY FOR STUDENTS


IBM (TECH SUPPORT) OF CAMPUS AT VIJAYAWADA

DETAILS:

company name: 

IBM


location: 

dhanekula college vijayawada

date: 

07/09/2013

time: 

9am

registration: 

spot registration (no fee)

Qualifications:

 Any degree like B.Tech, B.E, MCA,MBA, M.sc, etc. and get 60% of marks throughout education.

selection process:

  • initial screening test (gd/jam)
  • voice and ascent
  • technical round (os,trouble shooting,ip)
  • fnal round

salary:         

2.3 lakh



Read more

format write protected pendrive

Click Start->Run.

2)Type regedit and hit enter.

4)Click on the plus sign next to HKEY_LOCAL_MACHINE

5)Click on the plus sign next to SYSTEM

6)Click on the plus sign next to CurrentControlSet

7)Click on the plus sign next to Control

8)Click on the plus sign next to StorageDevicePolicies

9)Write click on WriteProtect and click modify.

10)If the value data is 1 change it 0 and click ok.

11)Repeat steps 7 to 10 for ControlSet001 and ControlSet002 .

12)Close Registry editor and restart the computer.

-------------------------------------------------------------
If you don't find it in the registry, the best way is to create it yourself. Below is the procedure.

Start the Registry Editor

Go to the HKEY_LOCAL_MACHINE \ SYSTEM \ CurrentControlSet \ Control key

If there is no key called StorageDevicePolicies, create it
.
You do this by right-clicking the HKEY_LOCAL_MACHINE \ SYSTEM \ CurrentControlSet \ Control key, and selecting New > Key from the menu.

Select the StorageDevicePolicies key

From the menu select Edit > New > DWORD Value

Name the new value WriteProtect

Right-click the WriteProtect value and choose Modify

In the Value Data: box enter 1

Exit the registry editor, and restart your computer
"To reverse, just delete the new WriteProtect value (or set the value to 0) and restart the computer
Read more