A

@Adarsh222

inline char

C
3 years ago
#include <stdio.h> static inline char add(){ char a[10]="hii adarsh"; printf("%s",a); } int main() { add(); }

Linked list

C
3 years ago
Data structures Array Linked List Stack Queue Binary Tree Binary Search Tree

Inline function

C
3 years ago
#include <stdio.h> static inline int no(){ //static should be used or it gives error return 2; } int main() { int a; a=no();

weekdays

C
3 years ago
#include <stdio.h> #if 0 enum week{sunday=1,monday,tuesday,wednusday,thursday,friday,saturday}; int main() { enum week w; w=friday; printf("%d\n\n",w); for(int i=sunday;i<=saturday;i++){

Find the no of words in a string

C
3 years ago
#include <stdio.h> #include <string.h> int main() { int a,i,n=0; int h=0; static int d[25]; char b[25]; //int d[25];

Function Char pointer

C
3 years ago
/*‘&’ is used to get the address of the variable. C does not have a string type, String is just an array of characters and an array variable stores the address of the first index location. By default the variable itself points to the base address and therefore to access base address of string, there is no need of adding an extra ‘&’ */ #include <stdio.h> #if 0

Function pointer

C
3 years ago
//pointer to function imp one please go to bellow link //https://www.scaler.com/topics/c/function-pointer-in-c/ In C, a function pointer is a pointer that points to the address of a function in memory. It can be used to call a function indirectly, through the function pointer. To declare a function pointer, you need to use the typedef keyword and specify the return type and the parameters of the function. Here is an example:

Realloc

C
3 years ago
#include <stdio.h> #include <stdlib.h> /*The realloc function in C is used to dynamically change the size of a previously allocated block of memory. It allows you to resize the memory block to either expand or shrink it.*/ int main(){ int *ptr; int n=1,n2=2;

if 1 100 else 50

C
3 years ago
#include <stdio.h> int add(int a); int main() { int n1=5,n2=6,c; int x; scanf("%d",&x); while(1){ //infinity loop while(1){}

100 50

C
3 years ago
#include <stdio.h> int add(); int main() { int n1=5,n2=6,c; while(1){ //infinity loop while(1){} c=add(); printf("%d",c);

add 2 no

C
3 years ago
#include <stdio.h> int add(int a,int b); int main() { int n1=5,n2=6,c; c=add(n1,n2); printf("%d",c); return 0; }

Taking string, char, sentence input

C
4 years ago
#include <stdio.h> #include <string.h> #include <math.h> #include <stdlib.h> int main() { char a; char b[30]; char c[30];

https://youtu.be/DWDxKHhEn6g

C
4 years ago
#include <stdio.h> int main() { printf("Hello world!\n"); return 0; }

Applications of Pointer

C
4 years ago
Applications of Pointers in C/C++ Difficulty Level : Easy Last Updated : 10 Jul, 2021 Prerequisite : Pointers in C/C++, Memory Layout of C Programs. To pass arguments by reference. Passing by reference serves two purposes (i) To modify variable of function in other. Example to swap two variables;

Pointer string

C
4 years ago
// fgets vs scanf #include <stdio.h> int main() { char str[100]; char *p; printf("Enter any string: \n"); fgets(str, 5, stdin);

Pointer Array

C
4 years ago
#include <stdio.h> #if 0 int main() { int a[6]; int *ptr[6]; for(int i=0;i<=5;i++){ scanf("%1d",&a[i]); }

Power of 2 or not

C
4 years ago
#include <stdio.h> //function prototype for checking power of two int checkPowerofTwo(int n); int main() { int num; printf("Enter the number you want to test: ");

struct all pointers

C
4 years ago
// Pointer to Structure #include <stdio.h> struct s{ char a[10]; int b; }; int main() { struct s s1;

Taking integer array input vs char array

C
4 years ago
#include <stdio.h> int main(){ int a[10]; int n=5; for(int i=0;i<n;i++){ scanf("%1d",&a[i]);// %1d reads a single digit }

Structure pointer

C
4 years ago
#include <stdio.h> struct p{ char name[20]; //dataType member1 int roll; }; //p1,p2; int main(){ struct p *ptr1,*ptr2,p1,p2; // replace if needed