sanfoundry
Master Chicken
精通编写hello world
展开
-
C Programming Test And Answer 10
1.Point out the error, if any in the program.#include<stdio.h>int main(){ int P = 10; switch(P) { case 10: printf("Case 1"); case 20: printf("Case 2")...原创 2020-05-04 20:40:17 · 280 阅读 · 0 评论 -
C Programming Test And Answer 09
1.What will be the output of the program?#include<stdio.h>int main(){ char ch; if(ch = printf("")) printf("It matters\n"); else printf("It doesn't matters\n"); ...原创 2020-05-02 21:36:45 · 366 阅读 · 0 评论 -
C Programming Test And Answer 08
1.What will be the output of the program ?#include<stdio.h>power(int**);int main(){ int a=5, *aa; /* Address of 'a' is 1000 */ aa = &a; a = power(&aa); printf("%d\n",...原创 2020-05-01 22:02:18 · 189 阅读 · 0 评论 -
C Programming Test And Answer 07
1.What is the output of the program#include<stdio.h>int main(){ struct emp { char name[20]; int age; float sal; }; struct emp e = {"Tiger"}; printf...原创 2020-04-30 14:10:54 · 851 阅读 · 0 评论 -
C Programming Test And Answer 06
1.If malloc() successfully allocates memory it returns the number of bytes it has allocated.A. True B. FalseExplanation:Syntax: void *malloc(size_t size);The malloc() function shall allocate unus...原创 2020-04-29 16:37:25 · 204 阅读 · 0 评论 -
C Programming Test And Answer 05
1.What will be the output of the program ?#include<stdio.h>int main(){ int a[5] = {5, 1, 15, 20, 25}; int i, j, m; i = ++a[1]; j = a[1]++; m = a[i++]; printf("%d, %d, ...原创 2020-04-28 18:19:45 · 251 阅读 · 0 评论 -
C Programming Test And Answer 04
1.What will be the output of the program?#include<stdio.h>int main(){ const char *s = ""; char str[] = "Hello"; s = str; while(*s) printf("%c", *s++); return 0;}...原创 2020-04-27 16:11:17 · 927 阅读 · 0 评论 -
C Programming Test And Answer 03
1.What will be the output of the program ?#include<stdio.h>int main(){ struct value { int bit1:1; int bit3:4; int bit4:4; }bit={1, 2, 13}; printf("%d,...原创 2020-04-26 16:08:36 · 1011 阅读 · 0 评论 -
C Programing Test And Answer 01
1.Are the three declarations char **apple, char *apple[], and char apple[][] same?A. TrueB. FalseCorrect Answer:Option BExplanation:char **apple - Pointer to pointer to a characterchar *apple[] ...原创 2020-04-23 17:57:43 · 446 阅读 · 0 评论 -
C Programming Questions and Answers – Arrays of Structures
原创 2020-04-10 20:15:55 · 89 阅读 · 0 评论 -
C Programming Questions and Answers – Structures and Functions
原创 2020-04-10 17:52:15 · 135 阅读 · 0 评论 -
C Programming Questions and Answers – Basics of Structures
原创 2020-04-10 17:36:31 · 100 阅读 · 0 评论 -
C Language Complicated Declarations
For reading complex pointer declarations there is the right-left rule.But this rule does not mention how to read const modifiers.For example in a simple pointer declaration, const can be applied in ...原创 2020-04-05 22:59:42 · 137 阅读 · 0 评论 -
C Language Pointers to Functions
Pointers to functionsA pointer to function can be initialized with an address of a non-member function or a static member function. Because of the function-to-pointer implicit conversion, the address...原创 2020-04-05 22:24:26 · 245 阅读 · 0 评论 -
Command Line Arguments
The main function of C language usually contains argc and argv, which are written as follows:int main(int argc,char *argv[])int main(int argc,char **argv)These two parameters are explained in deta...原创 2020-04-04 15:04:17 · 1374 阅读 · 0 评论 -
Pointers Vs. Multi-dimensional Arrays
Question 3:Explanation: Since every row in the array a[10][5] can contain only 5 characters, the a[2] element will hold “fello” i.e. 5 characters. There will not be any null character in a[2]. Since...原创 2020-04-04 14:25:03 · 143 阅读 · 0 评论 -
C Programming Questions and Answers – Initialization of Pointer Arrays
Question 6:Explanation: If the system is 32-bit system, then the size of pointer will be 4 bytes. For such a system, the size of array a will be 4×10 = 40 bytes. The size of pointer is 8 bytes on a ...原创 2020-04-04 13:57:53 · 126 阅读 · 0 评论 -
Multidimensional Arrays.c
原创 2020-04-04 13:26:59 · 131 阅读 · 0 评论 -
Pointers to Pointers.c
原创 2020-04-03 17:53:06 · 179 阅读 · 0 评论 -
Character Pointers and Functions.c
What will be the output of the following C code?Question 1:// Date:2020/4/3// Author:xiezhg5#include <stdio.h>#include <string.h>int main(void){ char*str="hello, world\n"; cha...原创 2020-04-03 17:01:32 · 128 阅读 · 0 评论 -
Macro Substitution – 2.c
Preprocessing functions commonly used are mainly provided by the C language ; the macro definition file contains conditional compilation对 #define 用法的几点说明宏定义是用宏名来表示一个字符串,在宏展开时又以该字符串取代宏名,这只是一种简单粗暴的替...原创 2020-03-13 21:18:38 · 157 阅读 · 0 评论 -
C Programming Questions and Answers – Pointers and Addresses.c
The same question:What will be the output of the following C code?Question 1:// Date:2020/3/29// Author:xiezhg5#include <stdio.h>int main(void){ int k=5; int *p=&k; int **m=&am...原创 2020-03-29 17:21:39 · 142 阅读 · 0 评论 -
C Programming Questions and Answers – Pointers and Function Arguments.c
The same question:What will be the output of the following C code?Question 1:// Date:2020/3/29// Author:xiezhg5#include <stdio.h>void foo(int*);int main(void){ int i=10,*p=&i; ...原创 2020-03-29 17:57:17 · 308 阅读 · 0 评论 -
C Programming Questions and Answers – Pointers and Arrays.c
The same question:What will be the output of the following C code?Question 1:// Date:2020/3/29// Author:xiezhg5#include <stdio.h>int main(void){ int a[3]={1,2,3}; int *p=a; printf(...原创 2020-03-29 20:54:20 · 182 阅读 · 0 评论