Of course for example I have been trying to do
Task 2
Code:
#include<stdio.h>
#include<stdlib.h>
int main{
int x=225;
int p=215;
int q=205;
int r=230;
int *p=NULL ;
int *q=NULL ;
int **q=NULL ;
int *r=NULL ;
int **r=NULL ;
int ***r=NULL ;
int x = 5;
int *p = &x;
*p = 6;
int **q = &p;
int ***r = &q;
printf (“%d\n”, *p);
printf (“%d\n”, *q);
printf(“%d\n”, **q);
printf(“%d\n”, **r);
printf(“%d\n”, ***r);
system("pause");
return 0;
}
In order compiler to compile but didnt get to output to learn answer
Also for task 5
I did like this but its not what it says
Code:
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#define size 20
int main()
{
char largest_word[size];
char smalest_word[size];
char wrd[size];
int ch;
printf("Enter a word: ");
scanf("%s", wrd);
strcpy(largest_word, wrd);
strcpy(smalest_word, wrd);
while(strlen(wrd) != 4 )
{
printf("Enter a word: ");
scanf("%s", wrd);
if( strcmp(smalest_word, wrd) > 0 )
strcpy(smalest_word, wrd);
if( strcmp(largest_word, wrd) < 0 )
strcpy(largest_word, wrd);
}
printf("The Smalest word: %s\n", smalest_word);
printf("The Largest word: %s\n", largest_word);
return 0;
}