C practicals

Q43 Write a C program to read the strings from a file.

Write a C program to read the strings from a file.  #include <stdio.h> #include <stdlib.h> int main() { char c[1000]; FILE *fpt…

Q42 Write a C program for file open, file write and file close.

Write a C program for file open, file write and file close. #include <stdio.h> #include <stdlib.h> int main() { int num; FILE *f…

Q41 Write a program to demonstrate the use of bitwise shift operators.

Write a program to demonstrate the use of bitwise shift operators. #include <stdio.h> int main() { int a=20; int c=0; c = a<&…

Q40 Write a C program that demonstrates bitwise logical operators.

Write a C program that demonstrates bitwise logical operators. #include <stdio.h> int main() { int a = 20; int b = 21; int …

Q39 Write a C Program to find sum and product using macros.

Write a C Program to find sum and product using macros. #include <stdio.h> #define SUM(x, y) (x + y) #define prod(t,r) t*r int main() { …

Q38 Write a C program to calculate area of circle using #define.

Write a C program to calculate area of circle using #define. #include <stdio.h> #include <conio.h> #define PI 3.141 int main() …

Q37 Write a C program to declare, initialize an union, example of union.

Write a C program to declare, initialize an union, example of union.  #include <stdio.h> union pack{ char a; int b; double c; }; int main() {…

Q36 Write a C program to demonstrate example of structure of array.

Write a C program to demonstrate example of structure of array. #include <stdio.h> struct student { char name [30]; int marks[ 5];…

Q35 Write a program in C to read and print a student’s detail using structure.

Write a program in C to read and print a student’s detail using structure. #include <stdio.h> struct student { char firstName[50]; …

Q34 Write a program in C to convert a string to uppercase.

Write a program in C to convert a string to uppercase.  #include <stdio.h> #include <string.h> int main() { char s[100]; int i; …

Q33 Write a program in C to read a sentence and replace lowercase characters by uppercase and vice-versa .

Write a program in C to read a sentence and replace lowercase characters by uppercase and vice-versa . #include <stdio.h> #include <strin…

Q32 Write a program in C to count total number of vowel or consonant in a string.

Write a program in C to count total number of vowel or consonant in a string. #include <stdio.h> #include <string.h> #define MAX_SIZE…

Q31 Write a program in C to copy one string to another string.

Write a program in C to copy one string to another string.  #include <stdio.h> #define MAX_SIZE 100 int main() { char text1[MAX_SIZE]; …

Q30 Write a program in C to count total number of alphabets, digits and special characters in a string.

Write a program in C to count total number of alphabets, digits and special characters in a string. #include<stdio.h> #include <string.h…

Q29 Write a program in C to compare two strings without using string library functions.

Write a program in C to compare two strings without using string library functions. #include <stdio.h> #define str_size 100 int test(char* s…

Q28 Write a program in C to print individual characters of string in reverse order.

Write a program in C to print individual characters of string in reverse order. #include <stdio.h> int main() { char str[1000], rev[1000]…

Q27 Write a program in C to input a string and print it.

Write a program in C to input a string and print it. #include <stdio.h> int main() { char array[100]; printf("Enter a string\n&q…

Q26 Write a program in C to find the length of a string without using library function.

Write a program in C to find the length of a string without using library function. #include <stdio.h> void main() { char string[50]; …

Q25 Write a program to implement pointer to function.

Write a program to implement pointer to function. #include <stdio.h> int sum(int x, int y) { return x+y; } int main() { int (*fp)(i…

Q24 Write a program to implement generic pointer.

Write a program to implement generic pointer. #include <stdio.h> #define SIZE 10 void printArray(void * vPtr, int size, int type); int main(…
Cookie Consent
We serve cookies on this site to analyze traffic, remember your preferences, and optimize your experience.
Oops!
It seems there is something wrong with your internet connection. Please connect to the internet and start browsing again.
AdBlock Detected!
We have detected that you are using adblocking plugin in your browser.
The revenue we earn by the advertisements is used to manage this website, we request you to whitelist our website in your adblocking plugin.
Site is Blocked
Sorry! This site is not available in your country.