D

@Dheerendra

18march)struct-06-typedef.c

C
3 years ago
//typedef - used as alias of a structure #include <stdio.h> #include<string.h> typedef struct computerengineeringstudent{ //typedef function to make int roll; //an alias of a structure float cgpa; char name

18march)struct-05.c

C
3 years ago
// Passing structure to function // function prototype #include <stdio.h> #include<string.h> struct student{ int roll; float cgpa; char name[100]; };

18march)struct-04.c

C
3 years ago
#include <stdio.h> #include<string.h> //user defined struct student{ int roll; float cgpa; char name[100]; }; int main() { struct student s2 = {1665,9.3,"Aman"}; // initializing a structure printf("Student roll : %d\n",s2.roll)

18march)struct-03.c

C
3 years ago
// array of structures #include <stdio.h> #include<string.h> //user defined struct student{ int roll; float cgpa; char name[100]; };

18march)struct-01.c

C
3 years ago
//write a program to store data of three students using structures #include <stdio.h> #include<string.h> //user defined struct student{ int roll; float cgpa; char name[100]; };

18march)shradha-strings-11.c

C
3 years ago
//Check if a given character is present in a string or not #include <stdio.h> #include<string.h> void checkChar(char str[], char ch); int main() { char str[] = "ApnaCollege"; char ch='e'; checkChar(str, ch);

18march)shradha-strings-10.c

C
3 years ago
// write a function to count the occurrence of vowels in a string #include <stdio.h> #include<string.h> int countVowels(char str[]); int main() { char str[]="Hello World"; printf("Vowels are : %d",countVowels(str)); return 0; }

18march)shradha-strings-09.c

C
3 years ago
// Slicing : write a function named slice, which takes string & // returns a sliced string from index n to m #include <stdio.h> #include<string.h> void slice(char str[],int n, int m); int main() { char str[100]; int a,b; scanf("%s",&st

18march)shradha-strings-08.c

C
3 years ago
// Salting = find the salted form of a password entered by user if the salt is // "123" & added at end. #include<stdio.h> #include<string.h> void salting(char password[]); int main(){ char password[100]; scanf("%s",password); salting(pa

18march)shradha-strings-06.c

C
3 years ago
/* take a string input from the user using %c Give input like= 1) aman \n 2)Shradha \n */ #include <stdio.h> #include<string.h> int main(){

17march)shradha-strings-05.c

C
3 years ago
//standard library functions #include <stdio.h> #include <string.h> int main() { char name[]= "Shradha"; int length = strlen(name);//to get length of string printf("length is %d",length); printf("\n");

17march)shradha-strings-05.c

C
3 years ago
// Make a program that input user's name & prints its length #include <stdio.h> void printString(char arr[]); int countLength(char arr[]); int main() { char name[100]; fgets(name, 100, stdin);//for taking input printf("Length is : %d",co

17march)shradha-strings-04.c

C
3 years ago
#include <stdio.h> void printString(char arr[]); int main() { char *canChange = "Hello World"; puts(canChange); canChange = "Hello"; puts(canChange);

14march)shradha-strings-03-gets.c

C
3 years ago
//printing full string using getsd method // you will get warning though #include <stdio.h> void printString(char arr[]); int main(){ char str[100]; gets(str); puts(str); //----

14march)shradha-strings-02.c

C
3 years ago
// // Ask the user to enter their firstName & print it back to them // #include <stdio.h> // void printString(char arr[]); // int main(){ // char firstName[50]; // scanf("%s",firstName); // printf("Your name is %s",firstName); //

14march)shradha-strings-01.c

C
3 years ago
// create a string firstName & Lastname to store details // of user & print all the characters using loop #include <stdio.h> void printString(char arr[]); int main(){ char firstName[] = "Shradha"; char lastName[] = "Khapra"; printS

25march)shradha-ptr-01.c

C
3 years ago
// // pointer-01 // #include <stdio.h> // int main() { // int aadhar[5]; // //input // int *ptr = &aadhar[0]; // for(int i=0; i<5; i++){ // printf("%d index : ",i); // scanf("%d",(ptr+i));

14march)shradha-pointer-02.c

C
3 years ago
// error #include <stdio.h> int main() { int age=22; int _age=23; int *ptr = &age; int *_ptr= &_age; printf("difference,%u - %u = %u\n",ptr,_ptr,(ptr)-(_ptr));

14march)pointer-01.c

C
3 years ago
// address of pointer #include <stdio.h> int main() { int age = 22; int *ptr = &age; printf("\nptr = %u",ptr); ptr++; printf("\nptr = %u",ptr); ptr--;

14narch)shradha-array-02.c

C
3 years ago
// array-02 // write a program to enter price of 3 items & print their final cost with gst #include <stdio.h> int main() { float price[3]; printf("Enter 3 prices : "); scanf("%f",&price[0]); scanf("%f",&price[1]);